Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Howto: Add JavaScript in HTML using VFP
Message
De
24/02/2005 04:41:55
 
 
À
24/02/2005 04:05:48
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00989993
Message ID:
00990000
Vues:
21
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform