简体   繁体   中英

How to load form in iframe?

I want to laod my page in iframe but I found nothing

my formDemand.js:

$(document).ready(function() {
    console.log("form demande............");
    var chauffeur = JSON.parse(sessionStorage.getItem("chauffeur"));

  console.log("data.userId"+chauffeur.userId);



  console.log("SUCCESSSSSSSSSS::::::::::"+chauffeur.emailAddress);
  $('#demande').html('<iframe src=http://147.282.192.216:8087/delegate/ticketservlet?mode=1&email='+ chauffeur.emailAddress+'name="myFrame"'+ 'id="idFrame" onload="'+trigger()+'">'+'</iframe>');
  console.log("DDDDDDDDDDDDDDD::::::::::");


  function trigger() {
      alert("Chargé");
}

in formDemand.html

<div id="demande" style="padding-left:10px;padding-right:10px;background:#fff;width:400;height:900;" >

result:

在此处输入图片说明

what's the problem please??

您的src属性缺少双引号。

$('#demande').html('<iframe src="http://147.282.192.216:8087/delegate/ticketservlet?mode=1&email='+ chauffeur.emailAddress+'" name="myFrame" id="idFrame" onload="'+trigger()+'">'+'</iframe>');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM