Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22595 > unrolled thread

How to I write if I want to use the passed caseID instead of the static number 999

Started by"Tony Johansson" <johansson.andersson@telia.com>
First post2014-01-13 13:15 +0100
Last post2014-01-13 14:10 +0100
Articles 4 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  How to I write if I want to use the passed caseID instead of the static number 999 "Tony Johansson" <johansson.andersson@telia.com> - 2014-01-13 13:15 +0100
    Re: How to I write if I want to use the passed caseID instead of the static number 999 Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-13 13:09 +0000
      Re: How to I write if I want to use the passed caseID instead of the static number 999 Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-01-13 18:19 -0200
    Re: How to I write if I want to use the passed caseID instead of the static number 999 Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-13 14:10 +0100

#22595 — How to I write if I want to use the passed caseID instead of the static number 999

From"Tony Johansson" <johansson.andersson@telia.com>
Date2014-01-13 13:15 +0100
SubjectHow to I write if I want to use the passed caseID instead of the static number 999
Message-ID<lb0ldf$83j$1@dont-email.me>
When I use the static literal 999 it works but I must use the passed 
parameter caseID instead when I create a query string

 function CallServerForUpdate(caseID)
       {
         xmlRequest.open("GET", 
"<%=Page.ResolveUrl("~/GoogleMapCallbackHandler.ashx?caseID=" + 999)%>", 
true);
           xmlRequest.onreadystatechange = ApplyUpdate;
           xmlRequest.send(null);
       }

//Tony 

[toc] | [next] | [standalone]


#22600

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2014-01-13 13:09 +0000
Message-ID<lb0oib$k2a$2@dont-email.me>
In reply to#22595
On Mon, 13 Jan 2014 13:15:18 +0100, Tony Johansson wrote:

> When I use the static literal 999 it works but I must use the passed
> parameter caseID instead when I create a query string
> 
>  function CallServerForUpdate(caseID)
>        {
>          xmlRequest.open("GET",
> "<%=Page.ResolveUrl("~/GoogleMapCallbackHandler.ashx?caseID=" + 999)%>",
> true);
>            xmlRequest.onreadystatechange = ApplyUpdate;
>            xmlRequest.send(null);
>        }

I suspect that you're mixing up server side and client side code here.

I don't know what uses <%= .... %> for server side code, but I suspect 
you may want something more like:

xmlRequest.open( 
"GET", 
"<%= Page.ResolveUrl("~/GoogleMapCallbackHandler.ashx" %>" + "?caseID=" + 
caseID, 
true);

You can't resolve your client side parameter to the function inside the 
server side code section, because that client side parameter doesn't 
exist when the server side processing generates the page to send to the 
client.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#22604

FromJoao Rodrigues <groups_jr-1@yahoo.com.br>
Date2014-01-13 18:19 -0200
Message-ID<lb1hp9$r6v$1@speranza.aioe.org>
In reply to#22600
On 13/01/2014 11:09, Denis McMahon wrote:
> On Mon, 13 Jan 2014 13:15:18 +0100, Tony Johansson wrote:
>
>> When I use the static literal 999 it works but I must use the passed
>> parameter caseID instead when I create a query string
>>
>>   function CallServerForUpdate(caseID)
>>         {
>>           xmlRequest.open("GET",
>> "<%=Page.ResolveUrl("~/GoogleMapCallbackHandler.ashx?caseID=" + 999)%>",
>> true);
>>             xmlRequest.onreadystatechange = ApplyUpdate;
>>             xmlRequest.send(null);
>>         }
>
> I suspect that you're mixing up server side and client side code here.
>
> I don't know what uses <%= .... %> for server side code,

It looks like ASP.NET server side code.

> but I suspect
> you may want something more like:
>
> xmlRequest.open(
> "GET",
> "<%= Page.ResolveUrl("~/GoogleMapCallbackHandler.ashx" %>" + "?caseID=" +
> caseID,
> true);
>

ACK.

-- 
Joao Rodrigues (J.R.)

[toc] | [prev] | [next] | [standalone]


#22601

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2014-01-13 14:10 +0100
Message-ID<3052564.tgVFKOa1l7@PointedEars.de>
In reply to#22595
Tony Johansson wrote:

> When I use the static literal 999 it works but I must use the passed
> parameter caseID instead when I create a query string
> 
>  function CallServerForUpdate(caseID)
>        {
>          xmlRequest.open("GET",
> "<%=Page.ResolveUrl("~/GoogleMapCallbackHandler.ashx?caseID=" + 999)%>",
> true);
>            xmlRequest.onreadystatechange = ApplyUpdate;
>            xmlRequest.send(null);
>        }

If you look closer into the server-side code, you will find that the 
concatenation operation there is superfluous – and probably, as it is, 
error-prone.  This should quickly lead you to realize where and how you have 
to put the parameter identifier in the client-side code.  Inspecting the 
client-side code would also help.  You have been pointed to debugging tools 
already; use them.

Trying to have others do your homework is a Really Bad Idea.

<http://PointedEars.de/faq#posting>

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web