Hi guys,
I’m using WiseJ 2.2.60 with VB.Net to develop a web application.
In a form, I put an IframePanel to host an external site.
Now I need to hide the top bar of this site with something like this:
document.querySelector(‘.header’).hidden = true;
but I don’t know how to add this javascript and to what event (I need that the content of the iframe is loaded)
Any suggestions ?
TY ALL,
Emiliano
Hi Emiliano,
Attached is a sample app.
The event you’ll need is the DocumentCompleted even.
You can use this.iFramePanel1.Eval(“some_js_code”) to evaluate javascript in the iFrame.
on the Client side, this.iFramePanel1.Eval(“this.getWindow()”) to get the framed window, and this.iFramePanel1.Eval(“this.getDocument()”) to get the framed document.
can also do this this.iFrame1.Call(“My_js_function”) and in My_js_function use this.getWindow() or this.getDocument(). If CORS allows it it returns the window or the document objects.
HTH,
Alaa
//
Hi Emiliano,
First of all, you’ll have to make sure that the website you’re framing is from the same origin, otherwise, the browser would block all cross-frame javascript.
There’s a similar topic here on the Forum, you can read all about it here.
Best,
Alaa
//
Hi Emiliano,
Can you elaborate on what’s the “top bar” you’re referring to?
It’s not really advised to use querySelector with Wisej.NET applications unless you have a specific way of identifying your widget. (i.e. something like a CSS Class name you made)
What you’re looking for is a child control, but without knowing which control you’re trying to modify it’s hard to guess!
Thanks,
Alaa
Please login first to submit.