开发者

Fire an event to a Form.Element.EventObserver using PrototypeJS

Basically, I have the same question as this one below:

http://www.mail-archive.com/prototype-scriptaculous@googlegroups.com/msg08682.html

In my case, I get this event observer:

new Form.Element.EventObserver( "selectId", function(element, value) {new Ajax.Updater('divId', '/path/1111', {asynchronous:true, evalScripts:true, onComplete: function(request, json){...}, parameters:'...'});});

I have no former experiences with Protot开发者_如何学Cype framework. Can someone tell me, after changing the value of 'selectId', how can I fire 'onChange' event on <select id='selectId'> control?

I have already tried 'Event.fire()' and 'selectId.onChange()' without any luck.

BTW, I cannot change the source code of that page. I need to write some javascript code in address bar in this format: "javascript: xxx".


It is possible with event.simulate.js as discussed in this question.

Since you are trying to do it via the address bar you'll have to first include the remote file in a manner similar to this question and answer.

Event.fire() only works for custom events, not native ones. Unfortunately.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜