$$HTMLHEAD or HTML Head Content access it with javascript?

Is there any way to access values generated in the $$HTMLHEAD or HTML HEAD CONTENT of a form via an onload event in javascript?

In the HTML HEAD CONTENT I am programatically creating a URL. I would like to pass this URL on to an onload javascript event that will load that URL in another frame

Heres the code i am using in the HTML HEAD CONTENT

DLINK := @IfError(@DbLookup(“Notes” : “NoCache”; @Subset(@DbName; 1) : “PFP.nsf”; “ImportHTMLFile”; html_file_name; 2);“Error!”);

X := “http://ddd.ddd.com/pfp.nsf/E58353F876F8285C85257394005E9CAD/“+DLINK+”/$FILE/”+html_file_name;

X

and in the onload event i would like something like this.

frm = window.document.forms[0];

URL = frm.$$HTMLHEAD.value;

window.parent.BottomArea.location.assign.frm.URL.value

but that javascript doesnt retrieve the value in $$HTMLHEAD, i get the error frm.$$HTMLHEAD.value is null or not an object

I think my syntax is wrong, but where?

Subject: $$HTMLHEAD or HTML Head Content access it with javascript?

$$HTMLHead and HTML Head Content create (parts of) the content of the HTML head element. Why would you want to put a plain URL there? The result is invalid HTML (at least).

Also your JS looks weired indeed. The assign method (never used that anyway) want the URL to be passed as an argument, not as a property.

Normally, you would code for the onload event in the form’s onload section. But since you want to use @Formuals to compute the URL, this is one possible way to do it: Write the whole onload code in the forms HTML Body Attributes section. The downside is, that you have to write your JS as a pure string in @Formulas. The advantage is that you can calculate all parts of the string as you like, e.g. using @DbLookup.

Subject: $$HTMLHEAD or HTML Head Content access it with javascript?

use $$HTMLHead to create a script tag, like so:

HEAD CONTENT DLINK := @IfError(@DbLookup(“Notes” : “NoCache”; @Subset(@DbName; 1) : “PFP.nsf”; “ImportHTMLFile”; html_file_name; 2);“Error!”);

X := “http://ddd.ddd.com/pfp.nsf/E58353F876F8285C85257394005E9CAD/“+DLINK+”/$FILE/”+html_file_name;

“<script type="text/javascript">var x_url = '” + X + “';”

Then your javascript can retrieve the url using the global “x_url” variable

Subject: RE: $$HTMLHEAD or HTML Head Content access it with javascript?

thank you… here is what i ended up using in the onload event with your solution…

window.parent.BottomArea.location.assign(x_url)

WORKS GREAT … thank you very much!