How to bind data of mysql from existing iframe into a new iframe on the same webpage


Joined
Oct 26, 2022
Messages
1
Reaction score
0
Hi

I have perl script in which onclick the column in left panel iframe the data got binded with right panel that works perfect. but how can i now bind data to a new iframe on right side by click on the cloumn of iframe on left side. please let me know i will be thankful to you
 
Ad

Advertisements

Joined
Jan 30, 2023
Messages
108
Reaction score
13
To bind data to a new iframe on the right side in your Perl script, you can use JavaScript to handle the click event on the column in the left panel iframe, then use JavaScript to dynamically create the new iframe on the right side and populate it with the data you want to bind to it.

Here's an example code snippet to get you started:

Code:
<iframe id="left-panel-iframe" onclick="bindDataToRightIframe(event)">
  <!-- Left panel iframe content -->
</iframe>

<div id="right-side">
  <!-- Right side content -->
</div>

<script>
  function bindDataToRightIframe(event) {
    // Get the data to bind from the click event
    const data = event.target.innerHTML;

    // Create the new iframe
    const rightIframe = document.createElement("iframe");
    rightIframe.id = "right-panel-iframe";
    rightIframe.srcdoc = data;

    // Append the new iframe to the right side
    document.getElementById("right-side").appendChild(rightIframe);
  }
</script>

Next time share your code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top