Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery Mobile 1.3.0 css不适用于多语言网站_Jquery_Asp.net_Jquery Mobile - Fatal编程技术网

jQuery Mobile 1.3.0 css不适用于多语言网站

jQuery Mobile 1.3.0 css不适用于多语言网站,jquery,asp.net,jquery-mobile,Jquery,Asp.net,Jquery Mobile,我正在开发一个基于asp.net网络表单的网站的多语言移动版本。到目前为止,一切都进展顺利,除了一个问题,即当我从一种语言切换到另一种语言时,应用程序下载纠正了CSS的版本,但除非我不按Ctrl+F5,否则无法生效 我使用英语和阿拉伯语版本,使用LTR和RTL方向,所以css需要更改 我不确定css是否以某种方式被缓存,即使HTML源代码显示了每种语言的css的正确版本,如下所示 英文版 <script src="../Scripts/jquery-1.7.1.js" type="text

我正在开发一个基于asp.net网络表单的网站的多语言移动版本。到目前为止,一切都进展顺利,除了一个问题,即当我从一种语言切换到另一种语言时,应用程序下载纠正了CSS的版本,但除非我不按Ctrl+F5,否则无法生效

我使用英语和阿拉伯语版本,使用LTR和RTL方向,所以css需要更改

我不确定css是否以某种方式被缓存,即使HTML源代码显示了每种语言的css的正确版本,如下所示

英文版

<script src="../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
<script src="script/jquery.mobile-1.3.0/jquery.mobile-1.3.0.js" type="text/javascript"></script>
<link href='script/jquery.mobile-1.3.0/jquery.mobile-1.3.0.css' rel='stylesheet' type='text/css' />
<link href='style/mobile-english.css' rel='stylesheet' type='text/css' />

阿拉伯文版

<script src="../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
<script src="script/jquery.mobile-1.3.0/jquery.mobile-1.3.0.js" type="text/javascript"></script>
<link href='script/jquery.mobile-1.3.0/jquery.mobile-arabic-1.3.0.css' rel='stylesheet' type='text/css' />
<link href='style/mobile-arabic.css' rel='stylesheet' type='text/css' />

场景

<script src="../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
<script src="script/jquery.mobile-1.3.0/jquery.mobile-1.3.0.js" type="text/javascript"></script>
<link href='script/jquery.mobile-1.3.0/jquery.mobile-1.3.0.css' rel='stylesheet' type='text/css' />
<link href='style/mobile-english.css' rel='stylesheet' type='text/css' />
例如,如果我先转到英语版本,然后单击阿拉伯语版本,它将使用英语CSS而不是阿拉伯语CSS,反之亦然。但是如果我按CTRL+F5,它就会使用正确版本的css


如果您能在这方面提供帮助,我将不胜感激。在这种情况下,您可以在加载新样式后刷新同一页面

$.mobile.changePage(
 window.location.href, { // or '#PageID'
    allowSamePageTransition: true,
    transition: 'none',
    showLoadMsg: false,
    reloadPage: true // Forces page reload if you're using 'window.location.href' or url
});
上述代码将重新加载页面而不进行
转换
,并刷新其内容


这里有一个。

在这种情况下,您可以在加载新样式后刷新同一页面

$.mobile.changePage(
 window.location.href, { // or '#PageID'
    allowSamePageTransition: true,
    transition: 'none',
    showLoadMsg: false,
    reloadPage: true // Forces page reload if you're using 'window.location.href' or url
});
上述代码将重新加载页面而不进行
转换
,并刷新其内容


下面是一个。

我通过使用以下jquery使它工作

$(document).ready(function () {
    $('form, a').removeAttr('data-ajax');
    $('form, a').attr('data-ajax', false);
});
我尝试了几种解决方案,但都不起作用,因为它一直使用CSS,这是第一次下载英文版或阿拉伯文版


禁用缓存可能还有其他问题,但另一方面,我必须使用正确版本的css,我通过使用以下jquery使其正常工作

$(document).ready(function () {
    $('form, a').removeAttr('data-ajax');
    $('form, a').attr('data-ajax', false);
});
我尝试了几种解决方案,但都不起作用,因为它一直使用CSS,这是第一次下载英文版或阿拉伯文版


禁用缓存可能会有其他问题,但另一方面,我必须使用正确版本的css

您的意思是在切换语言时不应用样式?@Omar:-例如,如果我先使用英语版本,然后单击阿拉伯语版本,则将使用英语css而不是阿拉伯语css,反之亦然。但如果我按CTRL+F5,它将下载使用正确版本的CSSY你的意思是切换语言时不应用样式?@Omar:-例如,如果我先使用英语版本,然后单击阿拉伯语版本,它将使用英语CSS而不是阿拉伯语CSS,反之亦然。但是如果我按CTRL+F5,那么它将使用正确版本的css下载