Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HTML onload function pointer says object required
Message
De
09/02/2005 20:51:04
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00985026
Message ID:
00985397
Vues:
42
This message has been marked as the solution to the initial question of the thread.
I'm not sure I follow what you're saying. Sounds like you're thinking of the form as spanning several frames. This is not the case. Each frame is a separate document with its own HTML, and a form only exists within a single frame. The code you execute in TargetOnLoad has no idea what the source frame name or location is (unless you tell it). Assuming your top frame is named "_first", you could say:

window.parent.frames("_first").document.forms("buttonform").showvars.style.visibility = "hidden";

or something like that.


>Thank you Randy,
>The "function" TargetOnloadHTML is an onclick action of a "button" in the top most frame, where, incidentally, the button I hope to hide also resides.
>
>The target or "location" I want want to fire the html (TargetOnload.htm) is the "last" frame of the frameset at the bottom og the form.
>
>I did things like "(script = "text/javascript" src="MyJavaScript.Js") and/or included a "window" in front of the onload (window.onload) and these attempts at least moved the the error to the function where the "showvars.visibility" resides. So I think you are correct - my reference for the "showvars" object (button) in the function is not "enough"!:(
>
>Any idea how an incoming javascript, targeted to a different frame than the event should render the "ancestry" of the button I want to hide in the forms("buttonsform") that is in the top (_Nanvigate) frames "src"?
>
>Thanks.
>
>>Window, in that scope is the target frame (_Launch), not the frame with the form and button. This there is no Window.document.forms("buttonform"). You would need to revise this code to refer back to the source frame, but that seems pretty awkward. Instead, maybe revise TargetOnLoadHTML() to hide the button *before* setting the launch location.
>>
>>-- Randy
>>
>>>A button onlclick fires this function:
>>>function TargetOnLoadHTML()
>>>{
>>>window.parent.frames("_Launch").location="TargetOnload.htm"
>>>}
>>>Which in turn fires this form:
>>><html>
>>><!--- TargetOnload.htm ---- >
>>><head>
>>><script language=javascript>
&gt;&gt;&gt;
&gt;&gt;&gt;function setShowvars()
&gt;&gt;&gt;{
&gt;&gt;&gt;window.document.forms("buttonform").showvars.style.visibility = "hidden";
&gt;&gt;&gt;}
&gt;&gt;&gt;
&gt;&gt;&gt;</script>
>>></head>
>>><body onload = 'setShowvars()';>
>>></body>
>>></html>
>>>That highlites the 'setShowvars()'; in the body tag and the error reports an object is required.
>>>
>>>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform