[jQuery] Re: Simple Queires for Function calling

2008-09-26 Thread MorningZ

"But in .js file it does not resolve the <%%> value. Any help would be
appreciated. "

As it shouldn't   you've got a .js file, which IIS treats as plain
ol text and passes through untouched, it will never get seen or more
importantly processed by ASP.NET

You've got options through:
1) Keep any dynamically created script in the asp or aspx page
2) create a new aspx page thats got all the JS markup inside it set
it's ContentType to "text/javascript"


But either way, the whole point of external js is so that the browser
will cache it so it only needs to be downloaded once, so having
changing values in a static js file doesn't make much sense anyways



[jQuery] Re: Simple Queires for Function calling

2008-09-26 Thread Richard D. Worth
Take a look at the metadata plugin:

http://plugins.jquery.com/project/metadata

- Richard

On Fri, Sep 26, 2008 at 7:09 AM, JQueryProgrammer
<[EMAIL PROTECTED]>wrote:

>
> Understand. But my issue is a bit different which i think i could not
> make it clear. I have a js file associated with every aspx page. Now
> my code is like
>
> 
>
> I tried to use the code (which is in my .js file) as:
>
> 
> $(function() { //document.ready
>  $("#myid").click(function() {
> alert( "Hello " + <%= myValueFromServer%> );
>  }
> });
>
> But in .js file it does not resolve the <%%> value. Any help would be
> appreciated.
>
> On Sep 26, 2:13 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> > The same with jQuery looks like this:
> >
> > 
> >