Tag: prototype

使用原型添加或删除类

无法在PROTOTYPE脚本中添加或删除基于click函数的img元素的“已选择”的css类名称(已经为Jquery做过)但它必须在Prototype中。 它让我疯狂。 不能让它适用于原型…. 我原来的代码是(Magento商店) __(‘Community Poll’) ?> <form id="pollForm" action="” method=”post” onsubmit=”return validatePollAnswerIsSelected();”> htmlEscape($poll->getPollTitle()); ?> <input type="radio" name="vote" style ="display:none;" class="radio poll_vote" id="vote_getId() ?>” value=”getAnswerId() ?>” /> getAnswerTitle(); $stripped_final = str_replace(” “, “_”, strtolower($stripped)); //Value (simplified) ?> <label for="vote_getId() ?>”><img src="http://www.passione.pt/media/poll/.png” id=”chooser” class=”chooser” alt=”htmlEscape($answer->getAnswerTitle()) ?>” onClick=”document.getElementById(‘vote_getId() ?>’).checked =true;”/> decorateList(‘poll-answers’); <button type="submit" title="__(‘Vote’) ?>” class=”button”>__(‘Vote’) ?> […]

继续中止AJAX(jqXHR)请求

是否可以继续中止AJAX(jqXHR)请求? 就像是: $(document).ajaxSend(function(event, jqXHR, ajaxOptions) { if(/* it enters my conditions */) { $.current_request = jQuery.extend(true, {}, jqXHR); jqXHR.abort(); } } // some time in the future $.ajax($.current_request) 这不起作用,我可以看到一个我不知道如何解决的问题:再次发送请求时没有设置任何选项。

防止ASP.NET MVC在Html Helper ID中使用下划线替换句点

刚刚升级到最新的ASP.NET MVC候选版本时,我注意到,当使用Html Helpers时,任何带有句点“。”的名称。 当输出元素的ID时,它将被下划线“_”替换。 我相信这是为了帮助使用JQuery ,并且使用句点是为了帮助使用ModelBinders。 这打破了我们使用原型的所有javascript,因为ID已全部更改。 有没有办法轻松关闭此function?