如何在iframe中加载表单?

时间:2016-03-03 11:00:03

标签: javascript cordova iframe

我想在iframe中铺设我的页面,但我找不到任何内容

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;" >

结果:

enter image description here

请问有什么问题?

1 个答案:

答案 0 :(得分:0)

您的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>');