p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: error: 'hi' is undefined


Message #1 by "Joseph Kushnir" <jkushnir52@h...> on Sun, 23 Sep 2001 10:37:18 -0400
the client and the server are totally disconnected..you cannot have a 
client sided script call a method on the server like this

either output the method you need to the server, or post/get (over http) 
back to the server and execute the sever method with the appropriate inputs.

/rob



At 10:37 AM 9/23/2001 -0400, you wrote:
>Hi,
>I am new in javascript and developed page where I call server side script 
>from client side to display data from db. The client side script looks 
>like this:
>//this is snipet//
><script>
>rsData=<%= hello('parseInt(targetid)')%>
></script>
>
>and the function that has to return me the string data is:
><%
>function hello(d)
>{
>var ret = new String
>ret="hi"
>return ret
>
>//return d
>}
>
>%>
>I have an error: 'hi' is undefined.
>
>if I change my client side to:
>//single quotes added//
><script>
>rsData='<%= hello('parseInt(targetid)')%>'
></script>
>it returns my string but I cannot manipulate integer sent ot this function.
>
>What I am doing wrong?
>
>Thanks in advance
>
>Joseph
>


Robert Chartier
Author and Developer
xxx-xxx-xxxx
rob@a...
http://www.aspfree.com/devlinks
http://www.aspfree.com/authors/robert
http://www.aspalliance.com/nothingmn


  Return to Index