Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Use Embed Plugin to embed Vanilla into AJAX div?

Okay, what I'm trying to do seems simple enough.

I have a div on my page which has content loaded to it dynamically via jQuery.load() and PHP include statements. For example, the when the user clicks on a navigation link on my home page, jQuery.load() loads the appropriate PHP file to the content div.

So far, this has been working fine, but I'm running into an issue when trying to load Vanilla into the content div via this method when the user clicks on the "Forum" button.

For a bit more clarity -- what actually happens is the button click triggers jQuery.load() on the content div. This loads "loadContent.php" to the content div with the requested page (ex: forum) passed as "pageID." loadContent.php checks if there's a page that matches the pageID, and then uses a PHP include to load the appropriate page.

When I set "pageID = forum" the script should load "forum.php" to the content div. This "forum.php" file contains a reference to the Vanilla Embed JavaScript file (just like the instructions say..just link it as a referenced script file). It's my thinking that using jQuery.load() to load this file to the content div should fill the div with the embedded Vanilla forum. However, rather than filling the content div, the entire page is replaced with nothing -- it is blank. The original page's DOM gets cleared, and the new one contains an iframe created by the embed plugin. This iframe is empty (it has #document, and tags, but it's all empty).

I assume it has something to do with the forum's embed script taking over the whole window, and not just the content div that it was loaded into. Does anyone have any ideas or a solution?

I did some searching, and other people seem to be having issues embedding Vanilla into an AJAX site too.

Let me know if I can clarify anything...I'm not sure how exactly to explain this.

Tagged:
Sign In or Register to comment.