FB Comments loaded via ajax div - ajax

Here's my issue, I'm trying to load a FB comments module via an AJAX div. Now, it works if I go directly to the php page, but if I load it from within the div, it doesn't. I've looked at the other posts (FB javascript SDK after jquery LOAD (ajax)), but still can't seem to get it to work, looking for clarification.
If you want to see what I'm talking about, check http://azconceptphoto.com/lindsey and check out testimonials.
Ideally, on the normal part of my site, I can just load the HTML5 code and it works fine, though for some reason it doesn't remotely work via the AJAX div. And considering the posts from before are out of date (2011), I was hoping to get more feedback on this.

Based on the code from your link you are not using any of the PrototypeJS Ajax methods to get the backend script. Ajax.Updater is the method you need to use so....
Here is my suggestion
change the definition of loadXMLDoc() to
function loadXMLDoc(div, location)
{
new Ajax.Updater(div,location,{'evalScripts':true});
}
this will update the contents of div with the contents of location. Also if the response has <script> tags in it then the javascript will be parsed and evaluated (thats the option evalScripts)

Related

Confusing WP page load with AJAX

My site is http://armandwho.com/site
I'm using the Adv. Ajax Page Loader Plugin in order to keep my background vid & music uninterrupted while browsing.
I'm having trouble with the "LOOK" page. When navigating to it from the homepage (1st link), the gallery doesn't load at all. However, when you refresh or go directly to the page URL it works.
Within the plugin, there is an area for jQuery reload codes, which I think will load the needed scripts that don't get loaded when using the nav.
Can anyone make sense of what script I might need to "reload" to get my gallery working with this Ajax plugin?
Help is supremely appreciated!
Joe
I loved the music, so I decided to look into the problem a bit.
I stepped through the code for the plugin as it tried to load the page and came across this line:
//Nothing like good old pure JavaScript...
document.getElementById(AAPL_content).innerHTML = output;
..which is a problem because the javascript in the script tags isn't going to be run. You could change it to:
//Nothing like good old pure JavaScript...
jQuery(document.getElementById(AAPL_content)).html(output);
..and jQuery will handle the dirty work.

Colorbox is not loading ajax content

Read Chain
$(".ReadChainDL").colorbox();
When I click the Read Chain it runs the ajax and loads the colorbox, but the colorbox is blank! I can confirm that ajax is running and pulling the correct content via firebug. It's just not populating the generated ajax content into the colorbox. I've confirmed via firebug that colorbox is blank.
I've tried it in Firefox and Chrome
It's got to be the URL; your code works fine. Proof: http://jsfiddle.net/HP8tN/
I think there are two main possibilities:
There's no filename, so maybe Colorbox doesn't know what content type to use. Or maybe the URL is wrong, or the target has the wrong content type. I think this is the most likely option. Try $(".ReadChainDL").colorbox({photo: true}); if it's a photo. Otherwise, check out the Content Type section in the documentation.
Colorbox is supposed to figure out whether you've passed it a URL or a jQuery-style XPath selector. The 10/12/2012 could be messing up whatever logic it uses to recognize a URL. This seems unlikely, since you've confirmed that something is coming back, but it's worth a try. Try 10%2F12%2F2012 instead.
Can you post the content that is being returned by the ajax call? jQuery may not be able to append it to your document if there are issues with it being invalid or malformed.
Try validating your content.

Load content via ajax in plone page

I'm working on a website which has been developed in plone. Now I'm facing an issue, I would like to load certain content from a template via an ajax call on normal Plone page(on some event trigger).
Do I need to create any python script??If yes where has it to be placed? and moreover how do I integrate it with TAL(I guess that would be needed) but I'm not sure how.
Could anyone guide me on this with necessary pointers/docs that I should look into?It would of great help to come over my issue and get things rolling.
Thanks,
Avinash
In the "Plone Developer Documentation" there's a section for Javascripting in Plone that perfectly fits your needs
Your question is a bit vague:
From your question, it seems that you just want your ajax call to return html to populate data on the page somewhere then?
Also, it sounds like you want to do the development TTW in the ZMI? Most developers would would use an add-on product and return your ajax response.
However, you can do it TTW with page templates just fine.
Create the new page template
populate it with the template code that gives you the desired output when called within the context of content on a site. For example, http://mysite.com/plone/page/my-template
in your javascript, use a url that in the ajax call: $.ajax({url: 'http://mysite.com/plone/page/my-template', success: function(data){ $('#content').append(data);}})
It's not really anything special to do ajax within plone--just use the tools available and piece it together.

swfobject not executes after ajax call

I've two php-scripts: the first makes ajax call to the second, which returns javascript code and div for swfobject. I'm calling the second file twice: after loading page(it works ok and I can see swfobjects) and after users' clicking on button(it not works and div just goes blank).
I suggest that embedSWF works ONLY after pages' loading, because my ajax calling is correct.
But a way must be found! Any ideas?
Yes, swfobject.embedSWF is designed to work after page load -- it has a built-in domload event handler.
If you don't want swfobject to automatically embed when the page is loaded, use swfobject.createSWF instead. The official documentation explains how swfobject.createSWF works.
EDIT:
After re-reading your post, I see you want to embed a SWF after the page has already loaded. swfobject.embedSWF can be used in both cases. Here's a tutorial and an example.

External HTML page, inside AJAX Iframe?

Hi Masters Of Web Development.
I have a not that simple question this time. I have got a simple external HTML page, that I want to include in my site. The HTML page contains a submit form or something like that, and I wish to send this data from the form, without to reload the whole page. So I decided to put HTML page inside iframe. But, some people said that this is older technology, google doesn't like iframes, etc. So I want to use something like AJAX or JQuery to load that external HTML page, and to send submit form without reloading the whole page with it. :)
Any suggestions on how to make this?
Thanks in advance :)
Do you really need Google to index that iframe form? If that's the only iframe you have throughout the site, it aint going to be a problem in terms of google indexing.
About using the Iframe, if you are not comfortable learning and building ajax-type form, you'll still be fine (like what Frankie commented). Just make sure the form works, usable and compatible with popular browsers.
You want to use the jQuery Forms Plugin. Its very straightforward and easy to turn any normal HTML form into an AJAX form.

Resources