Reputation: 1285
so I have created a link and am using jquery and ajax to load a new web page using this link, now is there anyway where I can change some content on this dynamically loaded page?
For example, the new page has a drop-down list, so can I somehow set the value of this drop-down list.
I tried to using the following in the load function
$('#content').load("inq.html #content",function(){
('selectid').val('optionvalue');
});
The selectid and optionvalue are in the loaded page.
This did not work.
Upvotes: -1
Views: 59
Reputation: 7106
your url appears to be malformed. something like "/inq.html#html"
Upvotes: 1
Reputation: 44215
It should work. In your example you forgot the jQuery object and didn't have the correct selector in the callback:
$('#content').load("inq.html #content",function(){
$('#selectid').val('optionvalue');
});
Upvotes: 1