2017-05-29 52 views
0

我目前有一個調用對話框的頁面。無法讓對話框中的腳本工作

在我的代碼,我包括以下內容:

<link rel="stylesheet" href="./croppie/croppie.css" /> 
<script src="./croppie/croppie.js"></script> 

的對話框使用下面的代碼調用,但包括的js文件不能正常呈現:

$('#upload_img_btn').on('click', function() { 
    var data = "<input id=filename1 name='__files[]' type='file' single /> <div class = 'profile-image' style='width: 130px; margin-left: 300px; margin-top:200px; width:200px; height: 200px; display:block;'><img class='crop-image' src='./train4.jpg'></div>"; 
    $('#upload_image').dialog('option', 'title', 'Upload Image'); 
    $('#upload_image').html(data).dialog('open'); 
    $('input'); 
}); 

如果我移動HTML (參見上面的var data語句)到正確顯示的文件中的主html區域(儘管不是不希望的對話框)。所以很明顯,對話框所需的js腳本無法正確渲染。如何讓js腳本可用於對話框?

+0

你是什麼意思「不適當渲染」?它是什麼樣子的?怎麼樣「將第二個對話框的html移動到文件中的主要html區域」?你的意思是'