gpt4 book ai didi

将 jQuery 添加到我的页面后,它无法正常工作

转载 作者:搜寻专家 更新时间:2023-10-31 22:32:25 25 4
gpt4 key购买 nike

我发誓我以前在我的页面上使用过 jQuery 一百万次,但由于某些原因这不起作用。就像什么都没有发生一样。

我添加了一个指向 jQuery.com 托管版本的外部链接。

有什么见解吗?

<html>
<head>
<meta charset="utf-8" />


<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js" />
<script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js" />
<script>

$(function() {
$( "#draggable3" ).draggable({ containment: "#containment-wrapper", scroll: false });


$("input[type=submit], a, button")
.button()
.click(function( event )
{
event.preventDefault();
$("#infobar").append('<p>Full name = ' + $("#first").val() + ' ' + $("#last").val() + ' </p>');
alert("Name added!");
});

$.getJSON('friends.json', function(data)
{
$.each(data, function()
{
$.each(this, function(k, v)
{
$("#infobar").append('<p>' + v.firstName + ' ' + v.lastName + '</p>');
});

});

});
});
</script>

<style>
.draggable { width: 50px; height: 50px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
#draggable, #draggable2 { margin-bottom:20px; }
#draggable { cursor: n-resize; }
#draggable2 { cursor: e-resize; }
#containment-wrapper { width: 95%; height:150px; border:2px solid #D00000 ; padding: 10px; border-style:dashed;}
#infobar {background: #E8E8E8; width:100%}
</style>

</head>
<body>


<div id="containment-wrapper">
First Name: <input type="text" name="firstname" id="first"><br>
Last name: <input type="text" name="lastname" id="last">
<input type="submit" value="Calclulate" />

<div id="draggable3" class="draggable ui-widget-content">
<p>LET ME OUT!</p>
</div>


</div>
<div id="infobar">

</div>



</body>
</html>​​​​​​​​​

最佳答案

<script>不会自动关闭

<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>

关于将 jQuery 添加到我的页面后,它无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13385774/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com