Forum Moderators: open

Message Too Old, No Replies

Dynamic JavaScript

JAvaScript using ASPs

         

neh2008

7:21 pm on Mar 14, 2003 (gmt 0)

10+ Year Member



Hi!

I am having a trouble with assigning the javascript variable the value of an ASP Statement.

var JavaScript_VAR=

"<% session.GetValue("ASP_var_Name",0) %>";

does this sound right? I get error 500 :(.

Please help.

TIA

Alternative Future

7:28 pm on Mar 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi neh2008,

Not sure on ASP but if it is anything alike JSP then the statement would start with <%= note the equals sign with assigns the value to the VAR.

HTH,

-gs

macrost

8:31 pm on Mar 14, 2003 (gmt 0)

10+ Year Member



Alternative,
You are correct, if you want to basically 'echo' using asp, then you would use something like this:
<%= Request.Form("blah") %>

Mac

korkus2000

8:36 pm on Mar 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That is just creating a response.write though. It shouldn't create a 500 error. I have not seen session.GetValue. What are you trying to do read from a session variable? Wouldn't it be easier to do this:

var JavaScript_VAR="<%=Session("ASP_var_Name")%>";

More info on the asp session object
[w3schools.com...]

neh2008

10:49 pm on Mar 14, 2003 (gmt 0)

10+ Year Member



I got it to work finally.

I would need an = sign after the <%

like in <%= ....

Thank you.

I am done with my work and whole project for the day. It takes some research, cant learn all scripting languages. But having used JSP helps.

Tx,
Neh2008

txbakers

12:06 am on Mar 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The basics of JSP and ASP are very similar, and with a background in JSP, you should have no trouble using ASP.NET which is really a rip off of JSP.

I'm going from ASP to JSP and having a ball with all the features that aren't possible with plain old ASP.

SEO practioner

7:21 pm on Mar 15, 2003 (gmt 0)

10+ Year Member



Since we have discovered the real power of JSP about a year and a half ago, as a rule, we always code in JSP where I am. No matter what Microsoft attemps to do with their .NET initiative, personally I think they are still behind JSP a whole lot, but thats my own personal opinion.

Would like to hear comments or personal views from other webmasters on WW

:-)

Alternative Future

7:33 pm on Mar 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well I can't praise JSP enough and it has a perfect match with the struts framework!

-gs

txbakers

12:27 am on Mar 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've coded for two years in ASP now so I'm very fluent in it, and just started JSP, so have to learn the new syntax and capabilities, but I'm very impressed with it, and I don't have to worry about changing from Microsoft servers to Linux or Mac or AS/400 down the road.

With ASP you're stuck. Even chilisoft has it's quirks with ASP.

I'm learning as I go with JSP and Java, so I'm not taking advantage of the full capabilities. My JSP pages look like ASP pages in Java, but I know there is so much more I can do once I learn about Beans and tag libraries.

I have two good books and lots of websites so I'll learn.

Thanks.

raymurphy

1:53 pm on Mar 19, 2003 (gmt 0)

10+ Year Member



Having used ASP for a couple of years now, I had been considering researching and learning ASP.NET and .NET in general as the next step - but here in the UK, an increasing number of corporate sites appear to be using JSP on their web sites, so I'm now more inclined to begin looking at JSP. txbakers - can you recommend any of these books and web sites (forum rules permitting) which you've found useful since you've been using JSP?

aspdaddy

2:03 pm on Mar 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd be keen for .JSP info too, I know nothing about it but it does sound promising.

Maybe a new thread about JSP?

Alternative Future

2:06 pm on Mar 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This might be of some help till another thread is in force:

jspinsider.com/tutorials/jsp/struts/strutsappendixb.view
jspin.com/
jsptut.com/Getfamiliar.html
And of course the finishing touches to a JSP would have:
jakarta.apache.org/struts/index.html

I have many more links and tutorials if anyone is interested!

-gs

raymurphy

3:16 pm on Mar 19, 2003 (gmt 0)

10+ Year Member



Yes please!

Thanks :)

Alternative Future

3:40 pm on Mar 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here are some more:

apl.jhu.edu/~hall/java/Servlet-Tutorial/
javaboutique.internet.com/tutorials/jsp.html
java.sun.com/products/jsp/

Some of the other links I had are reporting with broken links (tut tut to the webmaster ;-) anyway as I get more time I will keep adding to this post some other good ones I have kicking around!

Books are far the better tutorial if you are serious about getting into it.

-gs

txbakers

3:41 pm on Mar 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use all of the sites mentioned above. They are excellent. Of the ones listed, I think I like jspinsider the best. I was able to install a JavaMail API in about 10 minutes - the first time - with help from that site.

The book I used was called JavaServer Pages Developers Guide by Barry Burd. I liked it quite a bit.

Alternative Future

3:45 pm on Mar 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have to agree with txbakers,

The JavaMail API was a treat in comparison to cgi and all the older ways of processing a form (1 example of its usage).

Most of my books are at home, and I can't think of them off hand so I can't comment on books from where I am at this time :(

[added]A must have book that springs to mind is Core Servlets and JavaServer Pages by Marty Hall <- this guy knows his stuff[/added]

-gs

neh2008

1:14 pm on Apr 24, 2003 (gmt 0)

10+ Year Member



[pdf.coreservlets.com...]

here is the link to the whole book in PDF Format.

I am a Java fan since I got to know the power of java. I have used it for a couple of applications and am satisfied with it.

The next move for me would be J2EE.

Thanks

txbakers

1:27 pm on Apr 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for that link. Technology is amazing - I can download a 617 page technical book in under 5 minutes.

(And not have to pay for it......) Unless I'm supposed to buy it first?

garann

9:00 pm on Apr 25, 2003 (gmt 0)

10+ Year Member



[onjava.com...] (from O'Reilly) is ok, too. [javaranch.com...] has pretty helpful user forums and beginner tutorials, as well as a lot of lessons on theory that are helpful when moving towards beans and servlets.

g.