Cant build multiple iframes for vex-modal in php
Posted: 29 Mar 2018, 17:35
Dear admin i cant get the specivic id in my vex-modal script detected
i hope i can open multiply iframes in my script
i hope i can open multiply iframes in my script
Code: Select all
$sql = "SELECT * FROM `vpb_fetched_links_contents1` ORDER BY `id` DESC LIMIT $limit OFFSET $offset ";
try {
$stmt = $DB->prepare($sql);
$stmt->execute();
$results = $stmt->fetchAll();
} catch (Exception $ex) {
echo $ex->getMessage();
}
if (count($results) > 0) {
foreach ($results as $res) {
echo '
<button id="vex_t1'. $res['id'] .'">See Reviews</button>
<script>
var win_cnt = "<iframe src=http://145.53.93.209/comments/user/Tip-Us/Review-Comments.php?notice_id='. $res['id'] .' width=100% height=100% frameborder=0 scrolling=yes align=top marginwidth=0 marginheight=0 name=offtopic></iframe>"; // Defines the content
vex.defaultOptions.className = "vex-theme-default"; // specifies the css theme
// sets a function to be called when we need it (receives the string content)
var vex_alert1 = function(content) {
// calls the vex.dialog.alert() method to display the content
vex.dialog.alert(content)
};
// registers click event to #vex_t1, to call the vex_alert1() function
$("body").on("click", "#vex_t1'. $res['id'] .'", function(){ vex_alert1(win_cnt); } );
</script>