Closed MrAnalogy closed 5 years ago
I created a sample to demonstrate the problem. https://www.bungalowsoftware.com/test/colorbox.htm#
The link "Example of Problem" illustrates the problem.
jQuery failed to parse that page you are loading through ajax and is throwing an error. This doesn't actually have anything to do with the location/directory of the document nor does it have anything specifically to do with Colorbox (other that it uses jQuery's ajax). I would suggest using Colorbox's iframe property to load whole documents (instead of HTML snippets) so that the document is sandboxed rather than parsed into your current document. The way jQuery does handles documents in ajax is that it will parse that page for scripts and run them on the current document, which is probably not what you want.
I'm using the "display from html" without attaching it to an event handler.
IT works as long as the HREF is in the same directory or a a sub directory. But content never loads if the page being loaded is above the current page.
ASSUME: Directory html/sub1 html and sub1 both contain a file coaching.htm and there is an index.html file in /sub1 that contains the html below:
//this fails (it never loads) personal coaching
//this succeeds personal coaching
I also tried href: "./coaching.html" (since html/ is the root directory)