#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    6
    Rep Power
    0

    ASP and Javascript problem


    Hi i have created a few js files and saved them according to their category name.
    Now on loading a HTML page i want to load the js file according to the category of the product....
    how do i do this?
    I've tried this code but it does not work

    <script language=JavaScript src="info_files/<%=catRs.Fields (categoryproductcode).Value %>.js" >
    </script>

    This script is no good...dnt know how to do this...

    anyone plz help

    Thnks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Canada, Quebec, Montreal
    Posts
    410
    Rep Power
    12
    When you say "I've tried this code but it does not work"

    Are you getting an error?

    What do you see when you make a VIEW/SOURCE in your browser?

    Also, make sure you use the Trim() function over your
    <%=Trim(catRs.Fields (categoryproductcode).Value)%>

    This way your sure you won't end up having something like:

    filename .js <--notice the space before the .js

    these are just thoughts

    Hope this helps!
    Sincerely

    Vlince

IMN logo majestic logo threadwatch logo seochat tools logo