开发者

javascript not well-formed

开发者 https://www.devze.com 2023-03-06 14:49 出处:网络
I have an hmtl file which includes another javascript as <script type=\"text/javascript\" src=\"hello.js\"></script>

I have an hmtl file which includes another javascript as

<script type="text/javascript" src="hello.js"></script>
<div>
something
</div>

This html file is loaded via de .load() and it loads it in a div from the main page

This tells me that the first line is not well-formed

$(".flip").live("click", function() {

         $(this).find("div.panel").slideToggle("slow")
     });
     $(".flip").live("mouseover", function() {
         $(this).css('cursor', 'pointer');
     });

If i remove this, it will tell me the next element is not well-formed and so on. If I include this java开发者_高级运维script in a page which is not called via .load, it doesn't say any error. Is this because i'm calling this java script inside a div? and not in the head?


try to write the javascript code inde this function

$(document).ready(function(){
//Here insert your javascript code
});
0

精彩评论

暂无评论...
验证码 换一张
取 消