jquery和JavaScript脚本不起作用

jquery and javascript script not working

本文关键字:不起作用 脚本 JavaScript jquery      更新时间:2023-09-26

嗨,伙计们,我想知道您是否可以帮助我处理此代码以找出它不起作用的原因。它支持用一些架构代码填写文本区域。帮帮我解决这个问题,我卡住了。

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("input").keyup(function() {
    updateTemplate();
});
});
var Comunity = "Comunity";
var ot = "&lt;";
var ct = "&gt;";

function updateTemplate() {
comunityText = $("#myComunity").val();
thisStreet = $("#myAddress").val();
thisCity = $("#myCity").val();
thisState = $("#myState").val();
thisZip = $("#myZip").val();
thisUrl = $("#myUrl").val();
thisImgurl = $("#myImgurl")val();
thisDescription= $("#myDescription").val();
var template = "<div itemscope itemtype='"http://schema.org/" + Comunity + "'">'n";
template += "'t<div itemprop='"name'">" + comunityText + "</div>'n";
    if ($("#myLat").val() != "") {
    template += "'n't<div itemtype='"http://schema.org/GeoCoordinates'" itemscope='"'" itemprop='"geo'">'n";
        template += "'t't<meta itemprop='"latitude'" content='"" + $("#myLat").val() + "'" />'n";
        template += "'t't<meta itemprop='"longitude'" content='"" + $("#myLong").val() + "'" />'n";
    template += "'n't</div>";
}
template += "'n't<div itemtype='"http://schema.org/PostalAddress'" itemscope='"'" itemprop='"address'">'n";
    template += "'t't<div itemprop='"streetAddress'">" + thisStreet + "</div>'n";
    template += "'t't<div><span itemprop='"addressLocality'">" + thisCity + "</span>, <span itemprop='"addressRegion'">" + thisState + "</span> <span itemprop='"postalCode'">" + thisZip + "</span></div>'n";
template += "'t</div>'n";

template +=  "</div>'n";
$("#textOut").html(template);
$("#myOut").html(template);
}
</script>

thisImgurl = $("#myImgurl")val();

缺少一点。