mootools

how to receive XML in IE8 with mootools

て烟熏妆下的殇ゞ 提交于 2019-12-24 16:29:41
问题 I'm doing a web where I heavily use AJAX requests to a XML service. In fact, my web is a front-end with almost no server whatsoever and uses AJAX to communicate with the back-end. Everything was going fine (I developed and tested in Ubuntu 9.04 and Firefox 3.0 as a browser). One day I decided to see how my web did in IE8... horror! Nothing was working as it marvelously did in Firefox. To be more specific, the Request.HTML's were not working. As I said, my web relied heavily on that, so

Mootools Highcharts radio button toggle between charts, working jQuery version

偶尔善良 提交于 2019-12-24 16:15:12
问题 I've created a Highcharts implementation with a working jQuery-based radio button toggle "view select" between two charts: http://jsfiddle.net/6sAYF/ (it's in the lower-right) here is the working jQuery function and corresponding html: $(function() { $("[name=toggler]").click(function(){ $('.toHide').hide(); $("#0829-"+$(this).val()).fadeIn('fast'); }); }); <div id="0829-1" class="toHide" ></div> <div id="0829-2" class="toHide" style="display:none;width:780px;"></div> <label><input id="rdb1"

Set ajax request in joomla using mootools

假如想象 提交于 2019-12-24 12:07:45
问题 I am having a prob for ajax request in joomla using mootools. var url = '<?php echo JURI::base();?>index.php?option=com_test&task=getselectmode&selectedid='+$('parent_question').value; var params ={method: 'post',update:'test'}; var myAjax = new Ajax(url, params); myAjax.request(); My prob is that, is there any to set onComplete event of the ajax request. i have set it as below on above code but nothing happen. onComplete: function(response) { alert('Response: ' + response); } Can you please

Asset.css in jQuery

只谈情不闲聊 提交于 2019-12-24 11:47:07
问题 My application uses a Mootools class Asset to include CSS and JS files at run time. The line below used to include a CSS file: var myStyleSheet = Asset.css('/styles/myStyle.css'); I need to change this line to jQuery since the rest of the script is already in jQuery. How can we do that in jQuery? 回答1: There is a simple way to do it in plain javascript.. Just try the below lines and voila !! var cssfile=document.createElement("link") ; cssfile.setAttribute("rel", "stylesheet"); cssfile

Mootools: How to get redirected if ajax request returns redirect code?

China☆狼群 提交于 2019-12-24 11:04:18
问题 I need to redirect user if request returns 302 or 303. It seems that there isn't a standard way to do this (odd, I thought it's quite a common task). I have this code: var request = new Request({ url: "/some-url/", method: 'get', evalScripts: true, onComplete: function(){ console.log(this.status); } }); Console prints 0 status but web inspector shows that the status code is 302 Found, so I can't manually check the code and get redirected. Anyone know what I'm doing wrong? Thanks. 回答1:

Convert jQuery code to mootools 1.11

巧了我就是萌 提交于 2019-12-24 10:46:37
问题 I use a slideshow which needs mootools 1.11 and my other code needs jQuery. Unfortunately as soon as I call the jquery library the slideshow is crashing. Can I convert this little jquery code in to moo tools or pure javascript? How would the mootools code look like? jQuery(document).ready(function(jQuery) { jQuery('.rgstitle, .rgsdescription').click(function(event) { window.open(jQuery('#rgslideshow-4574 a img:visible').parent().attr('href'), '_self'); return false; }); }); Thanks a lot! 回答1:

Mootools extends the “Function” class with an “extend” method making jQuery unusable

北慕城南 提交于 2019-12-24 05:08:05
问题 Mootools extends the "Function" class and adds a new method called "extend" in it. Now jQuery tries to add "extend" function using jQuery.prototype.extend. However since "extend" is already a part of the jQuery object (since jQuery is an object of the Function class) so jQuery.prototype.extend doesn't work. Did anyone come across this conflict while using Mootools and jQuery simultaneously ? More generically, if a native class like "Function or Array or Object" is extended, do we have a way

JavaScript mootools addEvent

 ̄綄美尐妖づ 提交于 2019-12-23 18:18:08
问题 I am trying to find what's wrong with my code. Mootools core file is attached to HTML head and works well. If I add the code: $('myElement').addEvent('click', function(){ alert('clicked!'); }); right below the <div id="myElement">Click me</div> then it works. But if I add it to the separate javascript.js file then it does not work HTML is this: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="mootools-core-1.4.5-full-nocompat.js"></script> <script type="text/javascript" src=

Instantiate a Class dynamically via variable

蹲街弑〆低调 提交于 2019-12-23 11:56:18
问题 How can I instantiate a class by throwing in a variable name? Consider this method inside a class: animate: function(el, build) { console.log(build.effect); var animationClass = new build.effect(el,build); }, Build is an object containing lots of stuff, but most importantly an "effect". This effect is the name of an independent animation class-- one is called "MarioKartMenu". console.log(build.effect) prints out "MarioKartMenu". But of course I get: TypeError: Result of expression 'build

Instantiate a Class dynamically via variable

蓝咒 提交于 2019-12-23 11:56:05
问题 How can I instantiate a class by throwing in a variable name? Consider this method inside a class: animate: function(el, build) { console.log(build.effect); var animationClass = new build.effect(el,build); }, Build is an object containing lots of stuff, but most importantly an "effect". This effect is the name of an independent animation class-- one is called "MarioKartMenu". console.log(build.effect) prints out "MarioKartMenu". But of course I get: TypeError: Result of expression 'build