jQuery: The Write Less, Do More JavaScript Library

problem with .ajax POST and quotes

View: New views
11 Messages — Rating Filter:   Alert me  

problem with .ajax POST and quotes

by phicarre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Problem with .ajax with type = POST

error: missing ) after argument list

$output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
($id,";
$output .= "'" . $name . "'";
$output .= ")\">";

same error with

$output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
($id,";
$output .= "\"" . $name . "\"";
$output .= ")\">";

no error but display choice1(99, instead of choice1(99,"10")

$output .= "<div style='width:150px;'  ><a href='javascript:choice1
($id,";
$output .= "'" . $name . "'";
$output .= ")'>";

The calling function declares dataType as script

What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: problem with .ajax POST and quotes

by intrader-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It is not clear how you are calling the server, or what ajax
formulation you are using. Perhaps lack of encoding is the problem.

On Nov 7, 3:19 am, phicarre <gam...@...> wrote:

> Hi all,
>
> Problem with .ajax with type = POST
>
> error: missing ) after argument list
>
> $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> ($id,";
> $output .= "'" . $name . "'";
> $output .= ")\">";
>
> same error with
>
> $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> ($id,";
> $output .= "\"" . $name . "\"";
> $output .= ")\">";
>
> no error but display choice1(99, instead of choice1(99,"10")
>
> $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> ($id,";
> $output .= "'" . $name . "'";
> $output .= ")'>";
>
> The calling function declares dataType as script
>
> What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: problem with .ajax POST and quotes

by intrader-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, premature send.
1. It is not clear to me what choice1 is
2. It is not clear to me what $output is and where it is being issued
(server or client)
3. Please provide your script for your choice1 function
4. Please provide your AJAX code including the callback funtion.
5. Please provide the server code and what language it is in.
Thanks

On Nov 7, 8:56 am, intrader <intrader.intra...@...> wrote:

> It is not clear how you are calling the server, or what ajax
> formulation you are using. Perhaps lack of encoding is the problem.
>
> On Nov 7, 3:19 am, phicarre <gam...@...> wrote:
>
> > Hi all,
>
> > Problem with .ajax with type = POST
>
> > error: missing ) after argument list
>
> > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > ($id,";
> > $output .= "'" . $name . "'";
> > $output .= ")\">";
>
> > same error with
>
> > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > ($id,";
> > $output .= "\"" . $name . "\"";
> > $output .= ")\">";
>
> > no error but display choice1(99, instead of choice1(99,"10")
>
> > $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> > ($id,";
> > $output .= "'" . $name . "'";
> > $output .= ")'>";
>
> > The calling function declares dataType as script
>
> > What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: problem with .ajax POST and quotes

by phicarre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From client side (javascript + jquery) the calling function is:

function displayMember(code,idr)
    {
        var getVars = "code=" + code + "&id=" + idr;
        $.ajax(
        {
            type: "POST",
            url:'displayMember.php',
            dataType: 'script',
            data: getVars,
            success: function(resultat) {},
            error: function(requete,iderror) {alert(iderror);}
        })
    }

Server side, php language, the displayMember.php builds a string
($output) with data from a database.
$output is HTML code. Its a set of data inserted in a grid.
When a user clicks on a field, the javascript function choice1 is
executed.


On 8 nov, 02:54, intrader <intrader.intra...@...> wrote:

> Sorry, premature send.
> 1. It is not clear to me what choice1 is
> 2. It is not clear to me what $output is and where it is being issued
> (server or client)
> 3. Please provide your script for your choice1 function
> 4. Please provide yourAJAXcode including the callback funtion.
> 5. Please provide the server code and what language it is in.
> Thanks
>
> On Nov 7, 8:56 am, intrader <intrader.intra...@...> wrote:
>
> > It is not clear how you are calling the server, or whatajax
> > formulation you are using. Perhaps lack of encoding is theproblem.
>
> > On Nov 7, 3:19 am, phicarre <gam...@...> wrote:
>
> > > Hi all,
>
> > >Problemwith .ajaxwith type = POST
>
> > > error: missing ) after argument list
>
> > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > ($id,";
> > > $output .= "'" . $name . "'";
> > > $output .= ")\">";
>
> > > same error with
>
> > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > ($id,";
> > > $output .= "\"" . $name . "\"";
> > > $output .= ")\">";
>
> > > no error but display choice1(99, instead of choice1(99,"10")
>
> > > $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> > > ($id,";
> > > $output .= "'" . $name . "'";
> > > $output .= ")'>";
>
> > > The calling function declares dataType as script
>
> > > What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: problem with .ajax POST and quotes

by edwin@secureoffice.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi phicarre,

At first sight, there seems nothing wrong with the script in your
first example. I ran it at my pc and get no error. Your second example
will not work, since you open the href-string with double-qoutes, and
use them again around $name. You can only use single-qoute within the
string (or double-quotes if you use single-quotes around the string).

Try writing your $output script on one line:
$output .= "<div style='width:150px;'><a href=\"javascript:choice1
($id,'$name')\">";

and see what happens.

Is there a place where we can see your script?

Edwin

On Nov 8, 7:05 pm, phicarre <gam...@...> wrote:

> From client side (javascript + jquery) the calling function is:
>
> function displayMember(code,idr)
>     {
>         var getVars = "code=" + code + "&id=" + idr;
>         $.ajax(
>         {
>             type: "POST",
>             url:'displayMember.php',
>             dataType: 'script',
>             data: getVars,
>             success: function(resultat) {},
>             error: function(requete,iderror) {alert(iderror);}
>         })
>     }
>
> Server side, php language, the displayMember.php builds a string
> ($output) with data from a database.
> $output is HTML code. Its a set of data inserted in a grid.
> When a user clicks on a field, the javascript function choice1 is
> executed.
>
> On 8 nov, 02:54, intrader <intrader.intra...@...> wrote:
>
> > Sorry, premature send.
> > 1. It is not clear to me what choice1 is
> > 2. It is not clear to me what $output is and where it is being issued
> > (server or client)
> > 3. Please provide your script for your choice1 function
> > 4. Please provide yourAJAXcode including the callback funtion.
> > 5. Please provide the server code and what language it is in.
> > Thanks
>
> > On Nov 7, 8:56 am, intrader <intrader.intra...@...> wrote:
>
> > > It is not clear how you are calling the server, or whatajax
> > > formulation you are using. Perhaps lack of encoding is theproblem.
>
> > > On Nov 7, 3:19 am, phicarre <gam...@...> wrote:
>
> > > > Hi all,
>
> > > >Problemwith .ajaxwith type = POST
>
> > > > error: missing ) after argument list
>
> > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > ($id,";
> > > > $output .= "'" . $name . "'";
> > > > $output .= ")\">";
>
> > > > same error with
>
> > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > ($id,";
> > > > $output .= "\"" . $name . "\"";
> > > > $output .= ")\">";
>
> > > > no error but display choice1(99, instead of choice1(99,"10")
>
> > > > $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> > > > ($id,";
> > > > $output .= "'" . $name . "'";
> > > > $output .= ")'>";
>
> > > > The calling function declares dataType as script
>
> > > > What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: problem with .ajax POST and quotes

by phicarre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Same error with your proposition.

On 8 nov, 20:23, "ed...@..." <ed...@...>
wrote:

> Hiphicarre,
>
> At first sight, there seems nothing wrong with the script in your
> first example. I ran it at my pc and get no error. Your second example
> will not work, since you open the href-string with double-qoutes, and
> use them again around $name. You can only use single-qoute within the
> string (or double-quotes if you use single-quotes around the string).
>
> Try writing your $output script on one line:
> $output .= "<div style='width:150px;'><a href=\"javascript:choice1
> ($id,'$name')\">";
>
> and see what happens.
>
> Is there a place where we can see your script?
>
> Edwin
>
> On Nov 8, 7:05 pm,phicarre<gam...@...> wrote:
>
> > From client side (javascript + jquery) the calling function is:
>
> > function displayMember(code,idr)
> >     {
> >         var getVars = "code=" + code + "&id=" + idr;
> >         $.ajax(
> >         {
> >             type: "POST",
> >             url:'displayMember.php',
> >             dataType: 'script',
> >             data: getVars,
> >             success: function(resultat) {},
> >             error: function(requete,iderror) {alert(iderror);}
> >         })
> >     }
>
> > Server side, php language, the displayMember.php builds a string
> > ($output) with data from a database.
> > $output is HTML code. Its a set of data inserted in a grid.
> > When a user clicks on a field, the javascript function choice1 is
> > executed.
>
> > On 8 nov, 02:54, intrader <intrader.intra...@...> wrote:
>
> > > Sorry, premature send.
> > > 1. It is not clear to me what choice1 is
> > > 2. It is not clear to me what $output is and where it is being issued
> > > (server or client)
> > > 3. Please provide your script for your choice1 function
> > > 4. Please provide yourAJAXcode including the callback funtion.
> > > 5. Please provide the server code and what language it is in.
> > > Thanks
>
> > > On Nov 7, 8:56 am, intrader <intrader.intra...@...> wrote:
>
> > > > It is not clear how you are calling the server, or whatajax
> > > > formulation you are using. Perhaps lack of encoding is theproblem.
>
> > > > On Nov 7, 3:19 am,phicarre<gam...@...> wrote:
>
> > > > > Hi all,
>
> > > > >Problemwith .ajaxwith type = POST
>
> > > > > error: missing ) after argument list
>
> > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > ($id,";
> > > > > $output .= "'" . $name . "'";
> > > > > $output .= ")\">";
>
> > > > > same error with
>
> > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > ($id,";
> > > > > $output .= "\"" . $name . "\"";
> > > > > $output .= ")\">";
>
> > > > > no error but display choice1(99, instead of choice1(99,"10")
>
> > > > > $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> > > > > ($id,";
> > > > > $output .= "'" . $name . "'";
> > > > > $output .= ")'>";
>
> > > > > The calling function declares dataType as script
>
> > > > > What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: problem with .ajax POST and quotes

by phicarre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I must precise:
- I test with firefox
- I send to the client by the echo function
- I FORGOT THE MOST IMPORTANT: THE FULL STRING RETURNED IS
$('MY_GRID').HTML("$OUTPUT");

On 9 nov, 13:49, phicarre <gam...@...> wrote:

> Same error with your proposition.
>
> On 8 nov, 20:23, "ed...@..." <ed...@...>
> wrote:
>
> > Hiphicarre,
>
> > At first sight, there seems nothing wrong with the script in your
> > first example. I ran it at my pc and get no error. Your second example
> > will not work, since you open the href-string with double-qoutes, and
> > use them again around $name. You can only use single-qoute within the
> > string (or double-quotes if you use single-quotes around the string).
>
> > Try writing your $output script on one line:
> > $output .= "<div style='width:150px;'><a href=\"javascript:choice1
> > ($id,'$name')\">";
>
> > and see what happens.
>
> > Is there a place where we can see your script?
>
> > Edwin
>
> > On Nov 8, 7:05 pm,phicarre<gam...@...> wrote:
>
> > > From client side (javascript + jquery) the calling function is:
>
> > > function displayMember(code,idr)
> > >     {
> > >         var getVars = "code=" + code + "&id=" + idr;
> > >         $.ajax(
> > >         {
> > >             type: "POST",
> > >             url:'displayMember.php',
> > >             dataType: 'script',
> > >             data: getVars,
> > >             success: function(resultat) {},
> > >             error: function(requete,iderror) {alert(iderror);}
> > >         })
> > >     }
>
> > > Server side, php language, the displayMember.php builds a string
> > > ($output) with data from a database.
> > > $output is HTML code. Its a set of data inserted in a grid.
> > > When a user clicks on a field, the javascript function choice1 is
> > > executed.
>
> > > On 8 nov, 02:54, intrader <intrader.intra...@...> wrote:
>
> > > > Sorry, premature send.
> > > > 1. It is not clear to me what choice1 is
> > > > 2. It is not clear to me what $output is and where it is being issued
> > > > (server or client)
> > > > 3. Please provide your script for your choice1 function
> > > > 4. Please provide yourAJAXcode including the callback funtion.
> > > > 5. Please provide the server code and what language it is in.
> > > > Thanks
>
> > > > On Nov 7, 8:56 am, intrader <intrader.intra...@...> wrote:
>
> > > > > It is not clear how you are calling the server, or whatajax
> > > > > formulation you are using. Perhaps lack of encoding is theproblem.
>
> > > > > On Nov 7, 3:19 am,phicarre<gam...@...> wrote:
>
> > > > > > Hi all,
>
> > > > > >Problemwith .ajaxwith type = POST
>
> > > > > > error: missing ) after argument list
>
> > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > ($id,";
> > > > > > $output .= "'" . $name . "'";
> > > > > > $output .= ")\">";
>
> > > > > > same error with
>
> > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > ($id,";
> > > > > > $output .= "\"" . $name . "\"";
> > > > > > $output .= ")\">";
>
> > > > > > no error but display choice1(99, instead of choice1(99,"10")
>
> > > > > > $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> > > > > > ($id,";
> > > > > > $output .= "'" . $name . "'";
> > > > > > $output .= ")'>";
>
> > > > > > The calling function declares dataType as script
>
> > > > > > What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: problem with .ajax POST and quotes

by edwin@secureoffice.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You don't need qoutes around $OUTPUT if you are parsing a string. Just
$('MY_GRID').HTML($OUTPUT) would be enough.

On Nov 9, 3:19 pm, phicarre <gam...@...> wrote:

> I must precise:
> - I test with firefox
> - I send to the client by the echo function
> - I FORGOT THE MOST IMPORTANT: THE FULL STRING RETURNED IS
> $('MY_GRID').HTML("$OUTPUT");
>
> On 9 nov, 13:49, phicarre <gam...@...> wrote:
>
> > Same error with your proposition.
>
> > On 8 nov, 20:23, "ed...@..." <ed...@...>
> > wrote:
>
> > > Hiphicarre,
>
> > > At first sight, there seems nothing wrong with the script in your
> > > first example. I ran it at my pc and get no error. Your second example
> > > will not work, since you open the href-string with double-qoutes, and
> > > use them again around $name. You can only use single-qoute within the
> > > string (or double-quotes if you use single-quotes around the string).
>
> > > Try writing your $output script on one line:
> > > $output .= "<div style='width:150px;'><a href=\"javascript:choice1
> > > ($id,'$name')\">";
>
> > > and see what happens.
>
> > > Is there a place where we can see your script?
>
> > > Edwin
>
> > > On Nov 8, 7:05 pm,phicarre<gam...@...> wrote:
>
> > > > From client side (javascript + jquery) the calling function is:
>
> > > > function displayMember(code,idr)
> > > >     {
> > > >         var getVars = "code=" + code + "&id=" + idr;
> > > >         $.ajax(
> > > >         {
> > > >             type: "POST",
> > > >             url:'displayMember.php',
> > > >             dataType: 'script',
> > > >             data: getVars,
> > > >             success: function(resultat) {},
> > > >             error: function(requete,iderror) {alert(iderror);}
> > > >         })
> > > >     }
>
> > > > Server side, php language, the displayMember.php builds a string
> > > > ($output) with data from a database.
> > > > $output is HTML code. Its a set of data inserted in a grid.
> > > > When a user clicks on a field, the javascript function choice1 is
> > > > executed.
>
> > > > On 8 nov, 02:54, intrader <intrader.intra...@...> wrote:
>
> > > > > Sorry, premature send.
> > > > > 1. It is not clear to me what choice1 is
> > > > > 2. It is not clear to me what $output is and where it is being issued
> > > > > (server or client)
> > > > > 3. Please provide your script for your choice1 function
> > > > > 4. Please provide yourAJAXcode including the callback funtion.
> > > > > 5. Please provide the server code and what language it is in.
> > > > > Thanks
>
> > > > > On Nov 7, 8:56 am, intrader <intrader.intra...@...> wrote:
>
> > > > > > It is not clear how you are calling the server, or whatajax
> > > > > > formulation you are using. Perhaps lack of encoding is theproblem.
>
> > > > > > On Nov 7, 3:19 am,phicarre<gam...@...> wrote:
>
> > > > > > > Hi all,
>
> > > > > > >Problemwith .ajaxwith type = POST
>
> > > > > > > error: missing ) after argument list
>
> > > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > > ($id,";
> > > > > > > $output .= "'" . $name . "'";
> > > > > > > $output .= ")\">";
>
> > > > > > > same error with
>
> > > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > > ($id,";
> > > > > > > $output .= "\"" . $name . "\"";
> > > > > > > $output .= ")\">";
>
> > > > > > > no error but display choice1(99, instead of choice1(99,"10")
>
> > > > > > > $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> > > > > > > ($id,";
> > > > > > > $output .= "'" . $name . "'";
> > > > > > > $output .= ")'>";
>
> > > > > > > The calling function declares dataType as script
>
> > > > > > > What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.



Re: problem with .ajax POST and quotes

by phicarre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As you suggested I tried this:

$output .= "<div style='width:150px;'  ><a href=\"javascript:choix1
($id,'$nom')\">";
...
echo $('my_grid').html($output);

I have now this:

XML tag name mismatch (expected a)
<a href="javascript:choice1(99,'aaa')">aa...snormTR' ><td
class='dgRownorm' align='l

On 9 nov, 16:07, "ed...@..." <ed...@...>
wrote:

> You don't need qoutes around $OUTPUT if you are parsing a string. Just
> $('MY_GRID').HTML($OUTPUT) would be enough.
>
> On Nov 9, 3:19 pm,phicarre<gam...@...> wrote:
>
> > I must precise:
> > - I test with firefox
> > - I send to the client by the echo function
> > - I FORGOT THE MOST IMPORTANT: THE FULL STRING RETURNED IS
> > $('MY_GRID').HTML("$OUTPUT");
>
> > On 9 nov, 13:49,phicarre<gam...@...> wrote:
>
> > > Same error with your proposition.
>
> > > On 8 nov, 20:23, "ed...@..." <ed...@...>
> > > wrote:
>
> > > > Hiphicarre,
>
> > > > At first sight, there seems nothing wrong with the script in your
> > > > first example. I ran it at my pc and get no error. Your second example
> > > > will not work, since you open the href-string with double-qoutes, and
> > > > use them again around $name. You can only use single-qoute within the
> > > > string (or double-quotes if you use single-quotes around the string).
>
> > > > Try writing your $output script on one line:
> > > > $output .= "<div style='width:150px;'><a href=\"javascript:choice1
> > > > ($id,'$name')\">";
>
> > > > and see what happens.
>
> > > > Is there a place where we can see your script?
>
> > > > Edwin
>
> > > > On Nov 8, 7:05 pm,phicarre<gam...@...> wrote:
>
> > > > > From client side (javascript + jquery) the calling function is:
>
> > > > > function displayMember(code,idr)
> > > > >     {
> > > > >         var getVars = "code=" + code + "&id=" + idr;
> > > > >         $.ajax(
> > > > >         {
> > > > >             type: "POST",
> > > > >             url:'displayMember.php',
> > > > >             dataType: 'script',
> > > > >             data: getVars,
> > > > >             success: function(resultat) {},
> > > > >             error: function(requete,iderror) {alert(iderror);}
> > > > >         })
> > > > >     }
>
> > > > > Server side, php language, the displayMember.php builds a string
> > > > > ($output) with data from a database.
> > > > > $output is HTML code. Its a set of data inserted in a grid.
> > > > > When a user clicks on a field, the javascript function choice1 is
> > > > > executed.
>
> > > > > On 8 nov, 02:54, intrader <intrader.intra...@...> wrote:
>
> > > > > > Sorry, premature send.
> > > > > > 1. It is not clear to me what choice1 is
> > > > > > 2. It is not clear to me what $output is and where it is being issued
> > > > > > (server or client)
> > > > > > 3. Please provide your script for your choice1 function
> > > > > > 4. Please provide yourAJAXcode including the callback funtion.
> > > > > > 5. Please provide the server code and what language it is in.
> > > > > > Thanks
>
> > > > > > On Nov 7, 8:56 am, intrader <intrader.intra...@...> wrote:
>
> > > > > > > It is not clear how you are calling the server, or whatajax
> > > > > > > formulation you are using. Perhaps lack of encoding is theproblem.
>
> > > > > > > On Nov 7, 3:19 am,phicarre<gam...@...> wrote:
>
> > > > > > > > Hi all,
>
> > > > > > > >Problemwith .ajaxwith type = POST
>
> > > > > > > > error: missing ) after argument list
>
> > > > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > > > ($id,";
> > > > > > > > $output .= "'" . $name . "'";
> > > > > > > > $output .= ")\">";
>
> > > > > > > > same error with
>
> > > > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > > > ($id,";
> > > > > > > > $output .= "\"" . $name . "\"";
> > > > > > > > $output .= ")\">";
>
> > > > > > > > no error but display choice1(99, instead of choice1(99,"10")
>
> > > > > > > > $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> > > > > > > > ($id,";
> > > > > > > > $output .= "'" . $name . "'";
> > > > > > > > $output .= ")'>";
>
> > > > > > > > The calling function declares dataType as script
>
> > > > > > > > What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.



Re: problem with .ajax POST and quotes

by BIT BLT :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try closing the tags that you have opened, like this...
$output .= "<div style='width:150px;'  ><a href=\"javascript:choix1
($id,'$nom')\"> [click here] </a></div>";


On Nov 10, 5:03 am, phicarre <gam...@...> wrote:

> As you suggested I tried this:
>
> $output .= "<div style='width:150px;'  ><a href=\"javascript:choix1
> ($id,'$nom')\">";
> ...
> echo $('my_grid').html($output);
>
> I have now this:
>
> XML tag name mismatch (expected a)
> <a href="javascript:choice1(99,'aaa')">aa...snormTR' ><td
> class='dgRownorm' align='l
>
> On 9 nov, 16:07, "ed...@..." <ed...@...>
> wrote:> You don't need qoutes around $OUTPUT if you are parsing a string. Just
> > $('MY_GRID').HTML($OUTPUT) would be enough.
>
> > On Nov 9, 3:19 pm,phicarre<gam...@...> wrote:
>
> > > I must precise:
> > > - I test with firefox
> > > - I send to the client by the echo function
> > > - I FORGOT THE MOST IMPORTANT: THE FULL STRING RETURNED IS
> > > $('MY_GRID').HTML("$OUTPUT");
>
> > > On 9 nov, 13:49,phicarre<gam...@...> wrote:
>
> > > > Same error with your proposition.
>
> > > > On 8 nov, 20:23, "ed...@..." <ed...@...>
> > > > wrote:
>
> > > > > Hiphicarre,
>
> > > > > At first sight, there seems nothing wrong with the script in your
> > > > > first example. I ran it at my pc and get no error. Your second example
> > > > > will not work, since you open the href-string with double-qoutes, and
> > > > > use them again around $name. You can only use single-qoute within the
> > > > > string (or double-quotes if you use single-quotes around the string).
>
> > > > > Try writing your $output script on one line:
> > > > > $output .= "<div style='width:150px;'><a href=\"javascript:choice1
> > > > > ($id,'$name')\">";
>
> > > > > and see what happens.
>
> > > > > Is there a place where we can see your script?
>
> > > > > Edwin
>
> > > > > On Nov 8, 7:05 pm,phicarre<gam...@...> wrote:
>
> > > > > > From client side (javascript + jquery) the calling function is:
>
> > > > > > function displayMember(code,idr)
> > > > > >     {
> > > > > >         var getVars = "code=" + code + "&id=" + idr;
> > > > > >         $.ajax(
> > > > > >         {
> > > > > >             type: "POST",
> > > > > >             url:'displayMember.php',
> > > > > >             dataType: 'script',
> > > > > >             data: getVars,
> > > > > >             success: function(resultat) {},
> > > > > >             error: function(requete,iderror) {alert(iderror);}
> > > > > >         })
> > > > > >     }
>
> > > > > > Server side, php language, the displayMember.php builds a string
> > > > > > ($output) with data from a database.
> > > > > > $output is HTML code. Its a set of data inserted in a grid.
> > > > > > When a user clicks on a field, the javascript function choice1 is
> > > > > > executed.
>
> > > > > > On 8 nov, 02:54, intrader <intrader.intra...@...> wrote:
>
> > > > > > > Sorry, premature send.
> > > > > > > 1. It is not clear to me what choice1 is
> > > > > > > 2. It is not clear to me what $output is and where it is being issued
> > > > > > > (server or client)
> > > > > > > 3. Please provide your script for your choice1 function
> > > > > > > 4. Please provide yourAJAXcode including the callback funtion.
> > > > > > > 5. Please provide the server code and what language it is in.
> > > > > > > Thanks
>
> > > > > > > On Nov 7, 8:56 am, intrader <intrader.intra...@...> wrote:
>
> > > > > > > > It is not clear how you are calling the server, or whatajax
> > > > > > > > formulation you are using. Perhaps lack of encoding is theproblem.
>
> > > > > > > > On Nov 7, 3:19 am,phicarre<gam...@...> wrote:
>
> > > > > > > > > Hi all,
>
> > > > > > > > >Problemwith .ajaxwith type = POST
>
> > > > > > > > > error: missing ) after argument list
>
> > > > > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > > > > ($id,";
> > > > > > > > > $output .= "'" . $name . "'";
> > > > > > > > > $output .= ")\">";
>
> > > > > > > > > same error with
>
> > > > > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > > > > ($id,";
> > > > > > > > > $output .= "\"" . $name . "\"";
> > > > > > > > > $output .= ")\">";
>
> > > > > > > > > no error but display choice1(99, instead of choice1(99,"10")
>
> > > > > > > > > $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> > > > > > > > > ($id,";
> > > > > > > > > $output .= "'" . $name . "'";
> > > > > > > > > $output .= ")'>";
>
> > > > > > > > > The calling function declares dataType as script
>
> > > > > > > > > What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.



Re: problem with .ajax POST and quotes

by phicarre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is the message sent by echo:
$('#my_grid').html("<div class = 'dgMainDiv'><table id='dgTable'
class='dgTable' cellpadding='0' cellspacing='0'> <tr
align='center'><td class='dgTitles'><table border='0' cellspacing='0'
cellpadding='0' style='width:100%'><tr><td rowspan='2' style='vertical-
align:middle;' align='center'>Résidents</td></tr></table><tr
class='dgRowsnormTR' ><td class='dgRownorm' align='left' ><div
style='width:150px;'  ><a href="javascript:choix1(99,'aaa')">aaa</a></
div></td></tr><tr class='dgRowsaltTR'><td class='dgRowalt'
align='left' ><div style='width:150px;'  ><a href="javascript:choix1
(97,'abc')">abc</a></div></td></tr><tr class='dgRowsnormTR' ><td
class='dgRownorm' align='left' ><div style='width:150px;'  ><a
href="javascript:choix1(87,'Dupont&Dupont')">Dupont&Dupont</
a></div></td></tr><tr class='dgRowsaltTR'><td class='dgRowalt'
align='left' ><div style='width:150px;'  ><a href="javascript:choix1
(90,'éàè')">éàè</a></div></td></tr><tr class='dgRowsnormTR' ><td
class='dgRownorm' align='left' ><div style='width:150px;'  ><a
href="javascript:choix1(93,'éàè')">éàè</a></div></td></tr><tr
class='dgRowsaltTR'><td class='dgRowalt' align='left' ><div
style='width:150px;'  ><a href="javascript:choix1(88,'éàè')">éàè</a></
div></td></tr><tr class='dgRowsnormTR' ><td class='dgRownorm'
align='left' ><div style='width:150px;'  ><a href="javascript:choix1
(92,'éàè')">éàè</a></div></td></tr><tr class='dgRowsaltTR'><td
class='dgRowalt' align='left' ><div style='width:150px;'  ><a
href="javascript:choix1(91,'éàè')">éàè</a></div></td></tr><tr
align='center'><td align='left' colspan='1' class='dgPagRow'><br /></
td><td class='dgPagRow' align='right'></td><td class='dgPagRow'
align='right'></td><td class='dgPagRow' align='right'></td></tr></td></
tr></table></div>")

and I have once again the message "missing ) after argument list"

On 10 nov, 14:43, BIT BLT <morse.n...@...> wrote:

> Try closing the tags that you have opened, like this...
> $output .= "<div style='width:150px;'  ><a href=\"javascript:choix1
> ($id,'$nom')\"> [click here] </a></div>";
>
> On Nov 10, 5:03 am,phicarre<gam...@...> wrote:
>
> > As you suggested I tried this:
>
> > $output .= "<div style='width:150px;'  ><a href=\"javascript:choix1
> > ($id,'$nom')\">";
> > ...
> > echo $('my_grid').html($output);
>
> > I have now this:
>
> > XML tag name mismatch (expected a)
> > <a href="javascript:choice1(99,'aaa')">aa...snormTR' ><td
> > class='dgRownorm' align='l
>
> > On 9 nov, 16:07, "ed...@..." <ed...@...>
> > wrote:> You don't need qoutes around $OUTPUT if you are parsing a string. Just
> > > $('MY_GRID').HTML($OUTPUT) would be enough.
>
> > > On Nov 9, 3:19 pm,phicarre<gam...@...> wrote:
>
> > > > I must precise:
> > > > - I test with firefox
> > > > - I send to the client by the echo function
> > > > - I FORGOT THE MOST IMPORTANT: THE FULL STRING RETURNED IS
> > > > $('MY_GRID').HTML("$OUTPUT");
>
> > > > On 9 nov, 13:49,phicarre<gam...@...> wrote:
>
> > > > > Same error with your proposition.
>
> > > > > On 8 nov, 20:23, "ed...@..." <ed...@...>
> > > > > wrote:
>
> > > > > > Hiphicarre,
>
> > > > > > At first sight, there seems nothing wrong with the script in your
> > > > > > first example. I ran it at my pc and get no error. Your second example
> > > > > > will not work, since you open the href-string with double-qoutes, and
> > > > > > use them again around $name. You can only use single-qoute within the
> > > > > > string (or double-quotes if you use single-quotes around the string).
>
> > > > > > Try writing your $output script on one line:
> > > > > > $output .= "<div style='width:150px;'><a href=\"javascript:choice1
> > > > > > ($id,'$name')\">";
>
> > > > > > and see what happens.
>
> > > > > > Is there a place where we can see your script?
>
> > > > > > Edwin
>
> > > > > > On Nov 8, 7:05 pm,phicarre<gam...@...> wrote:
>
> > > > > > > From client side (javascript + jquery) the calling function is:
>
> > > > > > > function displayMember(code,idr)
> > > > > > >     {
> > > > > > >         var getVars = "code=" + code + "&id=" + idr;
> > > > > > >         $.ajax(
> > > > > > >         {
> > > > > > >             type: "POST",
> > > > > > >             url:'displayMember.php',
> > > > > > >             dataType: 'script',
> > > > > > >             data: getVars,
> > > > > > >             success: function(resultat) {},
> > > > > > >             error: function(requete,iderror) {alert(iderror);}
> > > > > > >         })
> > > > > > >     }
>
> > > > > > > Server side, php language, the displayMember.php builds a string
> > > > > > > ($output) with data from a database.
> > > > > > > $output is HTML code. Its a set of data inserted in a grid.
> > > > > > > When a user clicks on a field, the javascript function choice1 is
> > > > > > > executed.
>
> > > > > > > On 8 nov, 02:54, intrader <intrader.intra...@...> wrote:
>
> > > > > > > > Sorry, premature send.
> > > > > > > > 1. It is not clear to me what choice1 is
> > > > > > > > 2. It is not clear to me what $output is and where it is being issued
> > > > > > > > (server or client)
> > > > > > > > 3. Please provide your script for your choice1 function
> > > > > > > > 4. Please provide yourAJAXcode including the callback funtion.
> > > > > > > > 5. Please provide the server code and what language it is in.
> > > > > > > > Thanks
>
> > > > > > > > On Nov 7, 8:56 am, intrader <intrader.intra...@...> wrote:
>
> > > > > > > > > It is not clear how you are calling the server, or whatajax
> > > > > > > > > formulation you are using. Perhaps lack of encoding is theproblem.
>
> > > > > > > > > On Nov 7, 3:19 am,phicarre<gam...@...> wrote:
>
> > > > > > > > > > Hi all,
>
> > > > > > > > > >Problemwith .ajaxwith type = POST
>
> > > > > > > > > > error: missing ) after argument list
>
> > > > > > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > > > > > ($id,";
> > > > > > > > > > $output .= "'" . $name . "'";
> > > > > > > > > > $output .= ")\">";
>
> > > > > > > > > > same error with
>
> > > > > > > > > > $output .= "<div style='width:150px;'  ><a href=\"javascript:choice1
> > > > > > > > > > ($id,";
> > > > > > > > > > $output .= "\"" . $name . "\"";
> > > > > > > > > > $output .= ")\">";
>
> > > > > > > > > > no error but display choice1(99, instead of choice1(99,"10")
>
> > > > > > > > > > $output .= "<div style='width:150px;'  ><a href='javascript:choice1
> > > > > > > > > > ($id,";
> > > > > > > > > > $output .= "'" . $name . "'";
> > > > > > > > > > $output .= ")'>";
>
> > > > > > > > > > The calling function declares dataType as script
>
> > > > > > > > > > What is the correct formulation ?

--

You received this message because you are subscribed to the Google Groups "jQuery UI" group.
To post to this group, send email to jquery-ui@....
To unsubscribe from this group, send email to jquery-ui+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=.