English 中文(简体)
无法在联合材料档案中点击事件
原标题:unable to call click event in JS file

如下:

 <input type="button" id="abc" name="TechSupport_PartsOrder" value="Open Editor" />

《联邦法典》如下:

$( #abc ).click(function () {
alert( x );
});

如今,如果将上述《联邦法典》提交联合材料,则不会奏效,而如果将《联邦法典》放在同一页上,则会处以罚款。 为什么发生这种情况,那就不是 t。

如果把黄顿的浮标功能称为:

 <input type="button" id="abc" name="TechSupport_PartsOrder" onclick="abc()" value="Open Editor" />

JQuery:

function abc()
{
 alert( x );
}

它运作良好。

最佳回答

在<代码>ready中校正 手递:

$(function() {
    $( #abc ).click(function() {
        alert( clicked );
    });
});
问题回答

你们是否确保了活动手被确定为仅次于。 正因为如此, j格建议把你的所有法典都列入你们的法典。

$(document).ready(function(){  
  //XXX code goes here
});

或许,在将事件内容装入电离层之前,你会试图指派事件手。

以下问题是否解决这一问题?

$(function(){
  $( #abc ).click(function () {
    alert( x );
  });  
})

你的法典在加入人力部之前可能会被召唤。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签