Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-20-2011, 05:50 PM   PM User | #1
chubbypama
New to the CF scene

 
Join Date: Apr 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
chubbypama is an unknown quantity at this point
Exclamation 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..
chubbypama is offline   Reply With Quote
Old 05-20-2011, 06:00 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,613
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
I guess here comes JavaScript’s same origin policy into play.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:47 AM.


Advertisement
Log in to turn off these ads.