Iframe in javascript variable with data from php
Topics related to client-side programming language.
Post questions and answers about JavaScript, Ajax, or jQuery codes and scripts.
-
JanMolendijk
- Posts:282
- Location:Holland Rotterdam
Iframe in javascript variable with data from php
Dear Admin i Hope you understand my Question
I would like to use your SimpleModal Windows script
But into my notice-script the code where i wanna add the SimpleModal
starts like this
I can`t add --> ' <-- anymore i need to change the whole code with " but...
then My IFRAME is not shown into the modal
Code: Select all
// content
var win_cnt = " <iframe src="All-Notice.php"
width="300" height="440" frameborder="0" scrolling="yes"
align="top" marginwidth="0" marginheight="0" name="offtopic">
</iframe>";
// Calls modalW1(), passing win_cnt, on click the button
$("#basic-modal .button").click(function (e) {
modalW1(win_cnt);
return false;
});
</script>
Edit:
After long trying I found a way to do it, but now it does not detect: $row['notice_id']
i trying many differents for detection but without any success.
Code: Select all
// content
var win_cnt = " <iframe src=/comments/user/User-Info/Notice-Plus.php?notice_id='. $row['notice_id'] .'</iframe>";
Admin
Posts:805
The content you want to show in <iframe> must be defined in the page from the "src" address of that iframe.
To add your <iframe> in a php page, into a javascript variable, try this code in the js <script>:
Code: Select all
var win_cnt ='<iframe src="/comments/user/User-Info/Notice-Plus.php?notice_id='+<?php echo $row['notice_id']; ?> +'"></iframe>';
JanMolendijk
Posts:282
Dear Admin i just found they answer
I have to put '. $row['notice_id'] .' to the basic-modal, button & win_cnt...
All things are working corectly now.
Thanks for the support
Similar Topics
- Hour and Minutes togheter in Javascript
JavaScript - jQuery - Ajax
First post
Dear Coursesweb I can not find out how to add the hours + minutes togheter.
<SCRIPT LANGUAGE= JavaScript >
day = new Date()
hr =...
Last post
See and use the following example:
<script>
var day = new Date();
let hr = day.getHours();
let mn = day.getMinutes();
let se =...
- Display message to every minute in Javascript
JavaScript - jQuery - Ajax
First post
Hello,
On eatch minute from the current hour I wanna have an message
I can not find out how to complete
I hope to get something like this (code...
Last post
If you only want to display a message to every minute, just use the setInterval() function. It calls a function repeatedly, over and over again, at...