Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old October 18th, 2005, 06:35 PM
1up 1up is offline
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The link is dynamic. I really need to get onto the server so I can see how he put that code in my Javascript. I am having trouble connecting to his server with the info he gave me.

Thanks for the help, I just wish I could give you a straight answer on this. I think the VBS script-link-thing needs to run outside of the Jscript.

Reply With Quote
  #12 (permalink)  
Old October 19th, 2005, 03:53 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

If the page is run on a webserver that processes the asp, everything should work ok.

The VBScript will be processed before the javascript is written to the page, so the link should get rendered as required.

Reply With Quote
  #13 (permalink)  
Old October 19th, 2005, 10:55 AM
1up 1up is offline
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It seems that the quotes are what screws it up, When the open quotes start the html expression, they close out before the 'courseID' variable. I think thats why its not being processed first.

Will having something like this work?>

var linkPage = course.asp?courseID=<%=(courseContent...

~~~~~
function GoToURL(){
if (self.status=="OK to proceed!")
{
        open("linkPage","_self")
}else....


Or do I have to change the syntax in the "open("linkPage"... part?

Reply With Quote
  #14 (permalink)  
Old November 2nd, 2005, 01:08 PM
1up 1up is offline
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, we tried the last bit o code and that does not work either.

Any ideas?

Reply With Quote
  #15 (permalink)  
Old November 2nd, 2005, 01:11 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

linkPage is a variable, so you don't need it in quotes...
Code:
open(linkPage, "_self")
Reply With Quote
  #16 (permalink)  
Old November 4th, 2005, 05:45 PM
1up 1up is offline
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, still not working.

I got an idea though. I posted the code for the ASP page it goes in so you can see it in its native location.

http://www.schumannmedia.com/webImages/htmlvbs.html

That may give a clearer picture to what may be causing this not to work.

Thanks for all of the input, this site rocks.

Reply With Quote
  #17 (permalink)  
Old November 5th, 2005, 02:26 PM
1up 1up is offline
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, now I am getting whats going on.

The code in this variable breaks the Javascript;

var nextPage = course.asp?courseID=<%=(courseContent.Fields.Item( "courseID").Value)%>&chapterNum=<%=(courseContent. Fields.Item(//"chapterNum").Value)%>&contentSection=<%=(courseCo ntent.Fields.Item("forwardSection").Value)%>

I did find that the output in the source file now reads:
var nextPage = course.asp?courseID=300&chapterNum=1&contentSectio n=2
var nextTest = chapterTest.asp?courseID=300&chapterNum=1

..so it means it is doing what it is supposed to be doing but it breaks the Javascript somehow.

Now I am really stumped

Reply With Quote
  #18 (permalink)  
Old November 5th, 2005, 08:29 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

This is not valid JavaScript:

var nextPage = course.asp?courseID=300&chapterNum=1&contentSectio n=2

Change the ASP code so the JavaScript ends up like this:

var nextPage = 'course.asp?courseID=300&chapterNum=1&contentSecti on=2';

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #19 (permalink)  
Old November 7th, 2005, 03:18 PM
1up 1up is offline
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

:D Rock, Rock on! :D

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Connection using VBScript (or) JavaScript reachsevar ASP.NET 1.0 and 1.1 Basics 1 November 27th, 2007 10:54 AM
JavaScript to VBScript Thomas82 Classic ASP Basics 1 July 29th, 2006 07:03 PM
Using VBScript variables in Javascript PL Classic ASP Basics 4 July 29th, 2004 03:05 PM
vbscript and javascript together erin VBScript 1 October 21st, 2003 02:48 PM
Using VBScript and JavaScript together jwalborn Classic ASP Professional 2 October 13th, 2003 10:06 AM



All times are GMT -4. The time now is 12:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.