Jason Brody
Jason Brody

Reputation: 368

How to give parameter values in jquery url

$('#add').click(function(){

            $.jeegoopopup.open({
                url: 'update.php?cids= <?php echo $dt['callerid'] ?> && eid= <?php echo $dt['eid'] ?> && sts= <?php echo $dt['status'] ?>',
                width: 500,
                height: 200,
                center: true,
                skinClass: 'jg_popup_round', 
                resizable: false,
                scrolling: 'no',

If i give parameter values in url, the button not performing action

can any one help me

Upvotes: 2

Views: 119

Answers (3)

Pratik Joshi
Pratik Joshi

Reputation: 11693

Updated

&& is WRONG in Query string , its only & . The && operator comes ONLY in logical operations like a==2 && b==2

Use proper quotes like following in JS Ajax code to concatenate PHP cariables.

url: 'update.php?cids='+<?php echo $dt['callerid'] ?>+'&eid='+<?php echo $dt['eid'] ?>+'&sts='+<?php echo $dt['status'] ?>,

Upvotes: 1

Jai
Jai

Reputation: 74738

You should check for the spaces after = and lookout for quotes and make a single & ampersands too:

url: 'update.php?cids=<?php echo $dt["callerid"] ?>&eid=<?php echo $dt["eid"] ?>&sts=<?php echo $dt["status"] ?>',
//--------------------^----------------------------^^---^-----------------------^^---^

There are issues with :

  1. Quotes
  2. && double ampersands.
  3. space after =

Upvotes: 0

Agha Umair Ahmed
Agha Umair Ahmed

Reputation: 1020

Use Double quotes instead of single quotes in start and end like this

url: "update.php?cids= <?php echo $dt['callerid'] ?> && eid= <?php echo $dt['eid'] ?> && sts= <?php echo $dt['status'] ?>"

and check your console also for errors

Upvotes: 0

Related Questions