views:

55

answers:

1

I'm a newbie programmer working with jQuery and wonder if anyone can help me out.

Essentially, I've created some html for a social button's section on our articles.

I've uploaded that with the aim of using jQuery's .load() function to pull it into every article.

It works in IE7, but not in Firefox or Chrome. Can anyone help fix it?

<script type="text/javascript">
$(document).ready(function(){

$('#shareBlock').load("http://i.thisis.co.uk/275563/binaries/sharebox.html");

});
</script>
+1  A: 

Based on the URL in your load() and the nature of the issue I believe you have a problem with same origin. If your URL is external/violates same origin in some way you will not be able to load it in this manner.

For more details check this out - http://en.wikipedia.org/wiki/Same_origin_policy

HurnsMobile
What is the URL of the site that you are making the request FROM?
HurnsMobile
There wasn't a security warning in IE, but the div was replaced. I'll have a go at hosting both pages on the same URL to see if that works
elksie5000
I was just testing it from page saved on Dropbox. I suspect that might be the reason. I'll put the share html and the script on the same domain. Hopefully that should work. :) The learning from journalist to coder is proving fairly steep. Thank God for websites like this.
elksie5000