Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
jQuery Sending GET Problem
Old 08-06-2008, 05:17 PM jQuery Sending GET Problem
Galaxian's Avatar
Dingleberry!

Posts: 825
Name: Rich
Location: United Kingdom
Trades: 0
This is a very basic problem that I can't seem to solve.

Code:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function out(lid) {
$.get("out.php", { id: lid } );
}
</script>

<a href="link.php" onclick="out(1)">test</a>
That doesn't work. Any solution?

Edit: Ok, so it seems that it's not getting enough time to send the request. Is there anyway of writing it like if($.get(blahblah).send()) { return true and set the onclick to return out(1)?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by Galaxian; 08-06-2008 at 05:45 PM..
Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
 
Register now for full access!
Old 08-06-2008, 06:04 PM Re: jQuery Sending GET Problem
Galaxian's Avatar
Dingleberry!

Posts: 825
Name: Rich
Location: United Kingdom
Trades: 0
My solution -_-;

Code:
function out(lid) {
        $.ajax({
            type: "GET",
            url: "out.php?id=" + lid,
            async: false,
            error:function(ajaxrequest){
                return false;
            },
            success:function(content){
                return true;
            }
        });
}
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Reply     « Reply to jQuery Sending GET Problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33048 seconds with 12 queries