[jQuery] All AJAX stopped working (JSON and .load())
Hello jQuery gurus!
I'm doing a little site called mytripfootprint.com which is still in
pretty early development
(not publicly released really)
I have two simple AJAX calls that both worked up until about last
night.
the user clicks on a url. it loads a page with an ID and brings back
this page
the url is http://www.mytripfootprint.com/tip/show/[ - id - ]
like for instance http://www.mytripfootprint.com/tip/show/7
which works fine.
the jQuery code looks like this:
$(".items p").click(function() {
$("#tipcontent").html("<img src=\"public/images/25-0.gif\" style=
\"margin-left: 330px; \"> ").fadeIn("slow");
var tipid = $(this).attr("tipid");
var url = "http://www.mytripfootprint.com/tip/show/"+tipid;
alert(url);
$("#tipcontent").load(url).slideDown("slow");
});
the load image pops up instantly and the alert returns the url above
which if you copy paste works fine.
2nd call is a JSON call
var url = "http://www.mytripfootprint.com/share/?" + "from="+ $
(".share").attr("from") + "&to=" + $(".share").attr("to") + "&co2=" + $
("#footprint").html() + "&message=" + $("#share_message").val() +
"&weather=" + weather + "&comments=" + comments;
$.getJSON(url, function(data){
$.each(data, function(index, value){
$("#shareurl").html("Pass this url on to your friends:
<a
href=\""+value['url']+"\">"+value['url']+"</a>")
$("#share_form").hide('slow');
$("#shareresult").fadeIn('slow');
});
});
any idea at all why this stopped working all of a sudden? what could
be the reasons behind this?
also, this is a ruby on rails site if that helps.
full JS can be found here
http://www.mytripfootprint.com/public/javascripts/mytripfootprint.js
any suggestions is greatly appreciated.
Johan