Tuesday, June 2, 2009

[jQuery] Re: Help getting a variable

lets say you have a page called data.php
you do not need to form a query string but you can place the variables in html tags with a specific ID in the URL you are requsting

data.php
======
$x = 5;
$y = 8;
<span id="x"><?php eceho $x; ?</span>
<span id="Y"><?php eceho $y; ?</span>


// this is the jquery to request from the above page
$.ajax({
URL:"data.php",
success: function(html) {
var x = $("#x", html);
var y = $("#y", html);
alet(x + ', ' + y);
});
}):

On Wed, Jun 3, 2009 at 12:20 AM, Dave Maharaj :: WidePixels.com <dave@widepixels.com> wrote:
I am trying to get 2 variables....but not sure how I can get them from the form
 
i have hard coded
$(this).ajaxSubmit({
    type:    'post',
    url:      '/joesmith/update/profile',
    data:     queryString,
                target:   '#profile',
    success:     function() {alert(queryString);}
            });
 
but where joesmith and profle are coded into the url: those are 2 variables i need to pass to the script
joe smith is in the browser url but profle is from a link.
 
Not sure how I can get those variables passed into the script.
The form ID is not editable, cant add _joesmith or anything
 
Ideas?
 
 
 
Dave

No comments: