Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Howto: Add JavaScript in HTML using VFP
Message
From
24/02/2005 04:41:55
 
 
To
24/02/2005 04:05:48
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00989993
Message ID:
00990000
Views:
20
Ingredients you need:

filetostr (load htm-file into a string variable)
stuffc() (insert a string into a string at a certain position)
at() (find somthing in a string, eg
<head>
)
+ (concatenate strings)
strtofile (save a string var to a file)
strategy:
search for "<HEAD>" in Upper(string) with AT(). After the "<HEAD>" stuff(c) your javascript code at that position+6, so after the ">".
There even may be attributes defined within the head, so don't be sure to find "<HEAD>", you may find "<HEAD ...attributes... >" or even no "<HEAD>" at all. Then add the "<HEAD>" section before "<BODY".

Well, and I'd say there must be some call to that javascript, eg. <Body onload="...call...">, but that depends...
Bye, Olaf.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform