|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
How do you pass an ASP vars to JS
----- My attempt -----------------------------------
<% dim unita, unitb unita = "http://www.mydomain/10835.jpg" unitb = "http://www.mydomain/10835b.jpg" %> <script> String unit1 = <% = unita %> String unit2 = <% = unitb %> function bigPic(image) { document.getElementById('big').src= image; } </script> -------------------------------------------------------------------- I get "unit1 undefined and unit2 undefined" |
|
#2
|
|||
|
|||
|
your code works fine for me.
|
|
#3
|
|||
|
|||
|
nothing wrong with the code???
the asp vars are created on the server.....once the asp-file leaves the server they no longer exist cos asp is converted to html. So those vars never get to the client... try putting js script in your asp by using response.write("<script>js code</script>") |
|
#4
|
|||
|
|||
|
Found a simple solution
Basic image swaps from thumbs to the 'Big' picture.
<% dim unita, unitb unita = "http://www.horsetrailerworld.com/ads/adimages/10835.jpg" unitb = "http://www.horsetrailerworld.com/ads/adimages/10835b.jpg" %> <img src="http://horsetrailerworld.com/ads/adimages/10835sm.jpg" onclick="document.getElementById('big').src= '<% = unita %>' "> <img src="http://horsetrailerworld.com/ads/adimages/10835bsm.jpg" onclick="document.getElementById('big').src= '<% = unitb %>' "> <p> <img src="http://mydomain/10835.jpg" alt="big" name="big" id="big"></p> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > How do you pass an ASP vars to JS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|