jQuery 内联脚本在 Firefox 4 中不起作用
我今天下载了 Firefox 4,发现我的网站无法按预期运行。当我在互联网上寻找答案时,我发现了需要通过
document.write('
我将所有内联代码复制并粘贴到外部文件中,这就是我现在添加内联脚本的方式(在所有浏览器中工作,部分在 firefox 4 中工作):来自有关标记的评论查询,我这里是链接: http://filetaxes4free.com/temporary/index.php
<script language="JavaScript">
document.write('
<script src="path/js/inlineScript.js"
type="text/javascript">
<\/script>'
);
</script>
我正在使用 jQuery 1.6.1,jQuery 选项卡(在代码中您可以看到它们通过不透明度切换设置为旋转和淡入/淡出)一些 jQuery 正在工作,有些则不工作;当事件 mouseover 和 mouseout 不起作用时文件名的更改,以及当事件 mouseover 和 mouseout 不起作用时的动画(这是 inlineScript.js 文件的内容)
jQuery(document).ready( function() {
jQuery( "#tabs" ).tabs().tabs({
fx: { opacity: 'toggle', duration: 1000 }}
).tabs('rotate', 3500, false);
jQuery("ul#frontModule li a img").live('mouseover mouseout', function() {
var fileName = jQuery(this).attr('src').search("-active");
if (event.type == 'mouseover' && fileName == -1 ) {
jQuery(this).attr("src", jQuery(this).attr("src")
.replace(".png","-active.png"));
}
else {
jQuery(this).attr("src", jQuery(this).attr("src")
.replace("-active.png",".png"));
}
});
/* LOGO anitmated text*/
jQuery( "#logo" ).airport(
[ 'small business web design',
'online marketing',
'search engine optimization',
'websonalized-com']
);
//menu animation
jQuery('#rightBody .menu li a').live('mouseover mouseout', function(){
if ( event.type == 'mouseover' )
jQuery(this).animate({ marginLeft: "15px" }, 500 );
else
jQuery(this).animate({marginLeft: "0" }, 500 );
});
//css for IE css3pie.com
if (window.PIE) {
//jQuery('.rounded').each(function() {
//PIE.attach(this);
//});
jQuery('.roundRightEI').each(function() {
PIE.attach(this);
});
}//end IE scripts
});
我需要对此进行哪些更改在 Firefox 4 中运行的脚本
I downloaded Firefox 4 today, and realized my site does not work as expected. As I looked for answers over the internet, I found solutions that called for adding the inline script by way of
document.write('<script src="path/js/inlineScript.js" type="text/javascript"><\/script>')
.
I copied and pasted all of my inline code to an external file, and this is how I am adding the inline script now (working in all browsers, and partially in firefox 4): from comments inquiry regarding the markup, I here is the link: http://filetaxes4free.com/temporary/index.php
<script language="JavaScript">
document.write('
<script src="path/js/inlineScript.js"
type="text/javascript">
<\/script>'
);
</script>
I am using jQuery 1.6.1, jQuery tabs (in code you can see they are set to rotate and fadein/fadeout through opacity toggle) Some of the jQuery is working and some is not; the change of the file name when event mouseover and mouseout is not working, and the animation on when event mouseover and mouseout is not working either (this is the content of inlineScript.js file)
jQuery(document).ready( function() {
jQuery( "#tabs" ).tabs().tabs({
fx: { opacity: 'toggle', duration: 1000 }}
).tabs('rotate', 3500, false);
jQuery("ul#frontModule li a img").live('mouseover mouseout', function() {
var fileName = jQuery(this).attr('src').search("-active");
if (event.type == 'mouseover' && fileName == -1 ) {
jQuery(this).attr("src", jQuery(this).attr("src")
.replace(".png","-active.png"));
}
else {
jQuery(this).attr("src", jQuery(this).attr("src")
.replace("-active.png",".png"));
}
});
/* LOGO anitmated text*/
jQuery( "#logo" ).airport(
[ 'small business web design',
'online marketing',
'search engine optimization',
'websonalized-com']
);
//menu animation
jQuery('#rightBody .menu li a').live('mouseover mouseout', function(){
if ( event.type == 'mouseover' )
jQuery(this).animate({ marginLeft: "15px" }, 500 );
else
jQuery(this).animate({marginLeft: "0" }, 500 );
});
//css for IE css3pie.com
if (window.PIE) {
//jQuery('.rounded').each(function() {
//PIE.attach(this);
//});
jQuery('.roundRightEI').each(function() {
PIE.attach(this);
});
}//end IE scripts
});
What changes do I need to make to make for this script to work in Firefox 4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试按以下方式包含您的脚本,看看是否有任何区别。
有时,脚本中的引号可能会干扰负责加载的声明中包含的引号。
Try including your script in the following way and see if that makes any difference.
Sometimes quotes within your scripts may interfere with quotes included in the declaration responsible for the loading.
实际上,我需要做的就是在从事件调用回调时添加“事件”一词。
旧代码:
新代码:
与 HTML5 和严格标准有关的内容
Actually all I needed to do was to add the word "event" when calling the callback from the event.
Old code:
New code:
Something having to do with HTML5 and strict standards