can you use the .load() to call an external page?
I have an HTML file that includes jquery.js file.. and has the following logic:
function myfunction(tagID){
$("#target" + tagID).load("http://externalserver/test/mysecondpage.php?tagVal=" + tagID,function(){
alert(tagID);
});
$("#target2" + tagID).empty();
}
Later on in the page, i have the following:
<td><a href="#" onclick="myfunction( '1104' )"> 1104</a>
<span id="target1104">Fill me in</span>
<span id="target21104">"erase me"</span>
</td>
When i click on the hyperlink, the call to mysecondpage.php is not happening.
target2 is emptied / erased.. and the alert shows the right tagID. but the value that mysecondpage returns is not showing up. and i know that the mysecondpage.php page is not even being called because when it is, it sets a status value in my database.
can you pass an external page to the load method? the page i'm trying to get is hosted on another server within our company...
any suggestions would be appreciated. I'm new to ajax and not an expert in javascript either.. so if you can explain in detail, that'd be great.
cheers.
Last edited by chubbypama; 05-20-2011 at 06:04 PM..
|