У меня есть следующий класс:
[GlobalMethods]
internal static class JQueryTest
{
static JQueryTest()
{
jQuery.OnDocumentReady(delegate
{
test();
test2();
});
}
[ScriptName("test")]
static void test()
{
Script.Alert("one");
}
[ScriptName("test2")]
static void test2()
{
Script.Alert("two");
}
}
, который генерирует следующий javascript:
//! Echo.JQueryScript.debug.js
//
(function($) {
Type.registerNamespace('Echo.JQueryScript');
////////////////////////////////////////////////////////////////////////////////
// Echo.JQueryScript._jQueryTest
window.test = function Echo_JQueryScript__jQueryTest$test() {
alert('one');
}
window.test2 = function Echo_JQueryScript__jQueryTest$test2() {
alert('two');
}
(function () {
$(function() {
test();
test2();
});
})();
})(jQuery);
//! This script was generated using Script# v0.7.4.0
Это почти правильно, мне просто нужны точки с запятой в конце window.test= ... and window.test2 = ... lines ie:
window.test = function Echo_JQueryScript__jQueryTest$test() {
alert('one');
};
window.test2 = function Echo_JQueryScript__jQueryTest$test2() {
alert('two');
};
Может, кто-нибудь еще скажет мне, что я должен делать?
Спасибо
Stu