|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
send variables from html to external file
I'm new to VBscript and I'm having problems.
I want to make a flash sniffer, but I'm having trouble sending variables from my html file to an external vbscript file (I want to have a generic vbscript that can be used by different files with different vairables). This is my html: Code:
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>Flash</title> <script type="text/vbscript"> <![CDATA[ Dim w=300 Dim h=200 Dim file="movie.swf" Dim dir="" Dim color="#ffffff" Dim version=6 Dim alturl="http://www.macromedia.com/go/getflashplayer" Dim altimage="noflash.gif" ' ]]> </script> </head> <body> <script type="text/vbscript" src="vbflash.vbs"></script> </body> </html> And vbflash.vbs processes the information, but when I try to run it, I get an error message (unterminated statement, or smething like that... I've also tried to put the variables inside the script tags, but then I don't get the error message, but nothing happens... This is the script: Code:
//check for Flash Player X
//script for IE on Win32 systems
on error resume next
Dim checkForFlash6
checkForFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash."& version)))
if checkForFlash6 = true then
document.write("<object data="""&file&""" classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" type=""application/x-shockwave-flash"" codebase="""&dir&""" width="""&w&""" height="""&h&"""><param name=""movie"" value="""&dir&"/"&file&""" /><param name=""menu"" value=""false"" /><param name=""quality"" value=""high"" /><param name=""bgcolor"" value="""&color&""" /></object>")
else
document.write("<a href="""&alturl&"""><img src="""&altimage&""" alt=""Sorry, no flash for you!"" /></a> ")
end If
|
|
#2
|
|||
|
|||
|
I suspect this may be more an xml issue than a script issue. I don't know the answer for you, sorry.
|
|
#3
|
|||
|
|||
|
I did a similar thing with Javascript, and it works fine, but it doesn't seem to recognize the variables in the html with vbscript.
I must add that when I hardcode those variables into the vbscript source code, the script works fine. It just doesn't pass the variables from the html to the script. What is the scope of variables declared in the head of the document with vbscript, does anyone know? Last edited by Alicia : January 30th, 2004 at 07:45 PM. |
|
#4
|
|||
|
|||
|
If u change the vbs file to a included file with extended filename "inc" in a asp page..It will work fine..
|
|
#5
|
|||
|
|||
|
Thanks, but I don't want to have to use asp. I want this script to be able to be used anywhere, whether they have asp in the server or not...
|
|
#6
|
|||
|
|||
|
U build your html and vbs..And i get the result disply in the IE:Sorry, no flash for you!..Do u think it works fine?
|
|
#7
|
|||
|
|||
|
Thsnk for trying, but that's what happens when it doesn't recognize the variables. If you make a MsgBox showing the html code that it's generating, you'll see that the values for alturl and altimage are emtpy (they should be a link to macromedia and noflash.gif).
It's so simple to do this in javascript, but I need the vbscript version to detect flash in older ie browsers. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > send variables from html to external file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|