jmansa
November 22, 2010, 12:00am
1
I’m trying to figure out how to make this line:
<a href="#" onclick="load('ajax.php?ga=mailboxresult&cn=user&nx=sent','contentarea');return false;">Go back</a>
Happen automatic without having to hit a link…
I have tryid to insert this:
<script type="text/javascript">
load('ajax.php?ga=mailboxresult&cn=user&nx=sent','contentarea');
</script>
But nothing happend… Any ideas is appreciated
The jQuery load() method is designed to retrieve content from another page not redirect, javascript has a build in function designed to do this
<a href="#" onclick="window.location='ajax.php?ga=mailboxresult&cn=user&nx=sent';">Go back</a>
jmansa
November 22, 2010, 7:12am
3
The jQuery load() method is designed to retrieve content from another page not redirect, javascript has a build in function designed to do this
<a href="#" onclick="window.location='ajax.php?ga=mailboxresult&cn=user&nx=sent';">Go back</a>
Yes, but this does not load the content within the “contentarea” and does not do it automatic?! Its not a redirection I’m looking for but an automatic load…
Are you using jQuery for your code library, or something else?
If you let us browse to a test page with your current code, we will have a working solution for you in a very short time.
Then the following should work, assuming that contentarea is an id attributed section on your page.
$(function () {
$('#contentarea').load('ajax.php?ga=mailboxresult&cn=user&nx=sent');
});
For full details, see the load documentation page.