Javascript 先加载JQuery,然后显示html页面内容?

Javascript 先加载JQuery,然后显示html页面内容?,javascript,jquery,html,Javascript,Jquery,Html,我有一个移动站点,不幸的是我不能直接访问HTML,所以我使用JQuery来设计它的宽度、高度等,问题是这个站点实际上有762px的宽度(对于PC来说是一个普通的站点),我给了320px的宽度(对于iPhone屏幕),一切都很好,但在页面加载时,它来自页面的中间,以适应320px的屏幕大小。我坚信,我的JQuery宽度代码(320px,尽管我也为一些其他元素指定了JQuery)是在html页面中加载内容之后执行的 (我在Opera mobile emulator 320x480上看到这个问题) 因

我有一个移动站点,不幸的是我不能直接访问HTML,所以我使用JQuery来设计它的宽度、高度等,问题是这个站点实际上有762px的宽度(对于PC来说是一个普通的站点),我给了320px的宽度(对于iPhone屏幕),一切都很好,但在页面加载时,它来自页面的中间,以适应320px的屏幕大小。我坚信,我的JQuery宽度代码(320px,尽管我也为一些其他元素指定了JQuery)是在html页面中加载内容之后执行的

(我在Opera mobile emulator 320x480上看到这个问题)

因此,如果我能够首先加载JQuery,那么页面中的内容(HTML)就可以解决这个问题。你们有什么建议吗

我的剧本如下

$(document).ready(function() {
$('head').append('<meta name="viewport" content="initial-scale=1.0, width=device-width" />');
$("table.bgContent").removeAttr("width");
$("table.bgContent").attr("width","320");
$("table.cart-header").removeAttr("width");
$("table.cart-header").css("background","none");
$("table.cart-header").css("border","none");
$("table.cart-header td:first").html('<a href="home.aspx"><img src="images/userdir/logomobile.gif" width="320" height="79" border="0"/></a>');
$('head').append('<meta name="viewport" content="initial-scale=1.0, width=device-width" />');
$("table:eq(2) td.bgHeaderBarCart").html(" ");
$('table.cart-header td:nth-child(2)').css('display', 'none');
$('hr').css('width','300px');
$('td.FormTextCart').removeAttr("width");
$('.cart-header').css('height','0px');
$('.ContentAreaCart').css('padding','0px');
$('.SpanOrderCenter').css({padding : '0px',   textAlign : 'left', fontWeight : 'normal', fontSize : '12px', width : '300px'});
});
$(文档).ready(函数(){
$('head')。追加('');
$(“table.bgContent”).removeAttr(“宽度”);
$(“table.bgContent”).attr(“宽度”,“320”);
$(“table.cart header”).removeAttr(“宽度”);
$(“table.cart header”).css(“背景”、“无”);
$(“table.cart header”).css(“border”、“none”);
$(“table.cart-header td:first”).html(“”);
$('head')。追加('');
$(“表:eq(2)td.bgHeaderBarCart”).html(“”);
$('table.cart-header td:nth child(2)').css('display','none');
$('hr').css('width','300px');
$('td.FormTextCart').removeAttr(“宽度”);
$('.cart header').css('height','0px');
$('.ContentAreaCart').css('padding','0px');
$('.SpanOrderCenter').css({padding:'0px',textAlign:'left',fontWeight:'normal',fontSize:'12px',width:'300px'});
});
只需在您的
标签中放置一个包装,例如:

<html>
<head>
</head>
<body>
    <div id="wrapper" style="display:none;">
    </div>
</body>
</html>

谢谢Luc的建议,但不幸的是,我没有权限访问html来添加div,就像你说的那样。。
$("#wrapper").show();