+ Start a Discussion

Javascript merge fields not working when including a script in visualforce page



I am trying to convert an S-Control to a VF page but am having trouble working out the VF 'method' for a particular situation.


In my old S-Control an event is caught by a javascript function in the header of the HTML file, and then merge fields with values such as the User ID are used to call some apex class functions.


To get the javascript in the head of the VF page I use the <apex:includeScript> tag. However, merge fields don't appear to work when you are including a file. Will I have initialise a set of global variables by passing the merge fields into a function from the onLoad event?


This kind of seems like I'm bending VF around to replicate my old solution which seems a bit pointless, if people with more VF knowledge (so that is probably everyone!) can point out a different way of approaching the problem please let me know.






I a sorry but I don't understand. What event is being caught by a javascript function?