所以我使用加载功能将文本加载到我的网页中。该文本最初被硬编码到页面中,但我正在使用load函数将其全部转移到文本文件中。 我的问题是,当我尝试在没有页面的情况下加载测试文件时,它只能在firefox中运行,但在另一个中使用firefox chrome和safari,所以它肯定是代码的问题。
以下是适用的代码
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
</head>
<body>
<p align="left" class="our_goal_text" style="text-indent: 5em">Our goal text</p>
<script> $(document).ready(function(){
$(".our_goal_text").load("our_goal.txt");
});
</script>
</body>
</html>
这是一个不起作用的。 Load脚本一直位于底部,文本文件应该插入名为about us的第二个选项卡式面板内容中。有一个“我们是谁。文本”和“out goals.text”
非常奇怪,但我排除了我的互联网设置,因为我制作了一个无标题页面(上面的代码)经过测试,它运行正常,因此加载脚本与safari或chrome不兼容。
谢谢
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title></title>
<!-- TemplateEndEditable -->
<!--stylesheet-->
<link href="Style.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="master">
<div id="Header">
<div id="logoholder">
<div id="socialmedia">
<!-- START SOCIAL MEDIA WIDGET -->
<ul id="socialbar"><li id="facebook"><a target="_blank" href="http://www.facebook.com/username"><IMG src="ToneOnTone-Square-SocialIcons/ToneOnTone-Square-48x48/48x48-Square-34-FB copy.png"></a></li><li id="twitter"><a target="_blank" href="http://twitter.com/username"><IMG src="ToneOnTone-Square-SocialIcons/ToneOnTone-Square-48x48/48x48-Square-34-TW copy.png"></a></li><li id="feed"><a target="_blank" href="http://username.featuredblog.com/?feed=rss2"><IMG src="ToneOnTone-Square-SocialIcons/ToneOnTone-Square-48x48/48x48-Square-34-RSS copy.png"></a></li><li id="youtube"><a target="_blank" href="http://youtube.com/username"><IMG src="ToneOnTone-Square-SocialIcons/ToneOnTone-Square-48x48/48x48-Square-34-YT copy.png"></a></li></ul><style>#socialbar img {border:0px;}#socialbar li img {width:40px; height:40px;}#socialbar li a:hover {position:relative;top:2px;}#socialbar{padding:0px;list-style: none outside none; margin:0px; position: static;}#socialbar li {display:inline;padding-right:10px;}#socialbar{width:250px;text-align:center;}</style>
<!-- END SOCIAL MEDIA WIDGET-->
</div>
</div>
</div>
<div id="Menuboxcontainer"><div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab notabboarder "tabindex="0">Home</li>
<li class="TabbedPanelsTab" tabindex="0">About</li>
<li class="TabbedPanelsTab" tabindex="0">Programs</li>
<li class="TabbedPanelsTab" tabindex="0">Get Involved</li>
<li class="TabbedPanelsTab" tabindex="0">Upcoming Events</li>
<li class="TabbedPanelsTab" tabindex="0">Contact</li>
</ul>
<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent"><div class="slideshow">
<!--
<div id="wrapper">
<div id="container">
-->
<div class="controller" id="prev"></div>
<div id="slider">
<div><img src="Pictures/girlnurse.jpg" alt="face1" width = 100%/><div id="textbox_register">
<h3 class="h4">Support H.E.E.D LIFE</h3>
<p> </p>
<p>Join the Fight Against Cancer</p>
<p>in New Jersey.</p>
<p> </p>
<p>Become a member</p>
<p class="redtext">Register and Login Now!</p>
</div></div>
<div><img src="Pictures/oldman.jpg" width=100% alt="face2"/>
<div id="textbox_perks">
<h3 class="h4">Screening Saves Lives</h3>
<p>Your odds of defeating cancer are greater when it is detected in its early stages.</p>
<p> </p>
<p>Sigh up and learn about our</p><p class="redtext">FREE!</p><p> screening program.</p>
</div></div>
<div><img src="pictures/mamadukes.jpg" alt="face3"width= 100% />
<div id="textbox_perks">
<h3 class="h4">Learn about our programs</h3>
<p class="redtext">Free Screenings for:</p>
<p>Breast</p><p>Colorectal</p><p>Prostate</p><p> and lung cancers</p>
<p class="redtext">Copay Assistance Program</p>
<p> and Various Health Evaluation Events</p>
</div>
</div>
</div>
<div class="controller" id="next"></div>
<!--</div>
</div>
-->
</div>
</div>
<div class="TabbedPanelsContent">
<div id="panelsbackground">
<div id="opaquebackground"><div id="aboutustext">
<table align="left" width="900" border="0" cellspacing=".25">
<tr>
<td width="200"><h3 align="center">
<img src="whitelogo1.jpg" width="190" height="150" /></td></h3>
<td width="600" height="200"><h3 align="left">Who are we</h3> <hr class="faded" />
<p align="left" class="Who_are_we_text" style="text-indent: 5em;">Who are we text</p></td>
</tr>
<tr>
<td width="200"></td>
<td width="600" align="left"><h3 align="left">Our goal</h3><hr class="faded" width="200" />
<p align="left" class="our_goal_text" style="text-indent: 5em">Our goal text</p></td>
</tr>
</table>
</div></div></div></div>
<div class="TabbedPanelsContent">
<div id="panelsbackground">
<div id="opaquebackground"><div id="aboutustext">
</table>
<table width="700" border="0" cellspacing=".25">
<tr>
<td><table width="750" border="0" cellspacing=".025" align="left" vspace="20">
<tr><h3 align="center">Programs</h3></tr>
<tr>
<td><h3>Community events<hr class="faded" /></h3></td>
<td><h3>Health Awareness<hr class="faded" /></h3></td>
<td><h3>Cancer prevention<hr class="faded" /><h3></td>
</tr>
<tr>
<td>2.1</td>
<td>2.1</td>
<td>2.3</td>
</tr>
<tr>
<td>3.1</td>
<td>3.2</td>
<td>3.3</td>
</tr>
</table></td>
</tr>
</table>
</div></div></div></div>
<div class="TabbedPanelsContent"><div id="panelsbackground"><div id="opaquebackground"><div id="getinvolvedtext">
<h2 align="center"> How Can You Help</h2><hr class="faded"/>
<h3 align="center">Become a Member</h3><p align="center"></p>
<h3 align="center">Volunteer</h3><p align="left"></p>
<h3 align="center">Spread the word</h3><p align="left"></p>
<h3 align="center"> Suggestions</h3><p align="left"></p>
</div></div></div></div>
<div class="TabbedPanelsContent"><div id="panelsbackground"><div id="opaquebackground"><h2 align="center">Upcoming Events</h2><hr class="faded"/></div></div></div>
<div class="TabbedPanelsContent"><div id="panelsbackground"><div id="opaquebackground">
<div id="contactusboxright"></div>
</div></div></div>
</div>
</div>
</div>
<div id="contentboxcontainer">
<div class="contentboxLeft"><h1 align="center">Our Affiliates</h1><hr class="faded" /></div>
<div class="contentboxCenter"><h1 align="center">Free Screenings Across NJ</h1><hr class="faded" /></div>
<div class="contentboxRight"><h1 align="center" >News Letter</h1><hr class="faded" /></div>
<div id="footer">Address.Telephone.Email</div>
</div>
</div>
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<!--picture cycle javascript-->
<script src="jquery.cycle.all.js"></script>
<script type="text/javascript">
$('#slider').cycle({
fx: 'fade',
speed: 'fast',
next: '#next',
prev: '#prev'
});
</script>
<!--tabbed panel javascript-->
<!--<script type="text/javascript">
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
</script>-->
<!--about us text: who are we-->
<script type>
$(document).ready(function(){
$(".Who_are_we_text").load("Who_are_we.txt");
});
</script>
<!--about us text: our goal-->
<script> $(document).ready(function(){
$(".our_goal_text").load("our_goal.txt");
});
</script>
</body>
</html>