Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By fibo2358
#789927
Hello All,

I have created a dynaform with a panel. In the "content" property of the panel I have put an iframe

<iframe src="http://test.example.com/testfile.html" width="400" height="250" > </iframe>;

How can I get the current url or the current content that is displayed in the panel after user interaction?
I tried
$("#mypanel").find(".panel-body").html();
but it returns the original html defined in the "content" field.

Thanks in advance.
User avatar
By amosbatto
#789931
Give your iframe an ID like this:
Code: Select all
<iframe id="myFrame" src="http://test.example.com/testfile.html" width="400" height="250" > </iframe>;
Then you can use the following JavaScript code to get its content:
Code: Select all
var content = $("#myFrame").html()
To get its URL, you can use this:
Code: Select all
var url = $("#myFrame").attr("src")
By fibo2358
#789938
Hello Amos,

Thank you for the response.

I have just tried your solutions. They work fine but display the original URL / content of the panel as it was defined in the Panel "content" property.

However, the user can click on the webpage displayed in the panel (http://test.example.com/testfile.html) and after user interactions, redirections etc. the current URL / content can be different than the original one.
Lets's say that in the result the panel displays the page "http://test.example.com/result.html"

Is it possible to get the current (result) URL / content of the Panel in the JavaScript?

Thanks in advance.

Web3 development encompasses creating decentralize[…]

The Upland Clone Script, offered by Dappsfirm, rep[…]

Dappsfirm offers a bet365 clone script that mirror[…]

🚀 Tauchen Sie mit Immediate Alora AI in die Welt d[…]