我想使用 http://demos.jquerymobile.com/1.4.5/popup/ 创建弹出窗口。
这是 jquery 托管的 cdn 托管文件: https://jquerymobile.com/download/
据我所知 https://jsfiddle.net/hbaecklund/1zoj1pms/2/ 为什么不起作用?
这是我尝试使用 jquery 创建的内容。
$( "head" ).append ('<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /><script src="http://code.jquery.com/jquery-1.11.1.min.js"></script><script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>');
$( ".target" ).append('<a href="#popupCloseRight" data-rel="popup" class="ui-btn ui-corner-all ui-shadow ui-btn-inline">Right close button</a><div data-role="popup" id="popupCloseRight" class="ui-content" style="max-width:280px"><a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a><p>I have a close button at the top right corner with simple HTML markup.</p></div>');
最佳答案
在 JSFiddle 中,您必须在左侧菜单的“外部资源”下输入外部“css”和“js”文件:
除此之外,JSFiddle 要求使用 https 而不是 http。
这样做之后,your code works .
关于javascript - jQuery 移动插件弹出支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35652544/