Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

83 users online



javascript & asp

javascript & asp

Currently viewing this thread: 1 (0 members and 1 guests)


z1ppy

z1ppy

Status: Offline!

javascript & asp

Sorry this might be better in the Server side but im not sure. Anyway, using javascript i need to put a condition on a server variable from an asp recordset. This may make no sense cos Im clueless with JS but any help in the slightest would be a massive help.

Thanks

___________________

Please checkout my folio sites at Factory4.co.uk and z1ppy.deviantart.com

AljapaCo

AljapaCo

online since 96
Status: Offline!

I code in ASP, if you show some code I might be able to help out Shocked

___________________

...a post by Tobias from http://www.alingsasju-jutsu.se/aljapaco.png

z1ppy

z1ppy

Status: Offline!

<% varImage = rsProductsByCat.Fields.Item("imageavail").Value %>

<script language="JavaScript">
<!--

var jsVar = "<%= varImage %>";
if (jsVar == "true") { document.write("<img src="blah.jpg>") };

//-->
</script>

Grin

___________________

Please checkout my folio sites at Factory4.co.uk and z1ppy.deviantart.com

AljapaCo

AljapaCo

online since 96
Status: Offline!

Hmmm, are you trying to decide if there is an image in the DB and if so, post it!?

If that's the case, you don't need Javascript, you could just use:

Code:


<%
varImage = rsProductsByCat.Fields.Item("imageavail").Value
if varImage<>"" then
response.write "<img src="myImg.jpg">
end if
%>

Is that what you're trying to do here??? :confused:

___________________

...a post by Tobias from http://www.alingsasju-jutsu.se/aljapaco.png

z1ppy

z1ppy

Status: Offline!

<% varImage = rsProductsByCat.Fields.Item("imageavail").Value %>

<script language="JavaScript">
<!--

var jsVar = "<%= varImage %>";

if (jsVar == "True") { document.write("<img src='../product_images/<%= rsProductsByCat.Fields.Item("RealID").Value %>.jpg' lowsrc='../lowsrc/<%= rsProductsByCat.Fields.Item("RealID").Value %>.gif' onMouseDown='MM_openBrWindow('productpix.asp?id=<%= rsProductsByCat.Fields.Item("RealID").Value %>','prodwin','width=400,height=400')' border='0' align='top'>") };

//-->
</script>

Yeah that was what i was trying to do but the above code actually works now. I could be wrong but I think it needed to be javascript because the site shopping cart was built in JS, it didnt work when we tried asp. Anyway many thanks for the help Grin

___________________

Please checkout my folio sites at Factory4.co.uk and z1ppy.deviantart.com

AljapaCo

AljapaCo

online since 96
Status: Offline!

Yea I figured it was some sorta "if the product has an image, show it" script Wink

Great you got it to work, but it should be able to work with just ASP as well Shocked

___________________

...a post by Tobias from http://www.alingsasju-jutsu.se/aljapaco.png

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0078 seconds.