mootools

mootools / class / objectinstance doesn't work

Hey. I have no idea why i get a 'b' and not an 'a' when i call a.get(). Can someone help me? var tclass = new Class({ initialize:function(n){ this.options = Object.extend({'name' : n}); }, get:function(){ return this.options.name; } }); a = new tclass('a'); b = new tclass('b'); a.get() // b ...

Convert json object to json string and use it's functions?

I have a json object with a function: var thread = { title: "my title", delete: function() { alert("deleted"); } }; thread.delete(); // alerted "deleted" thread_json = JSON.encode(thread); // convert to json from object thread_object = JSON.decode(thread_json); // convert to object from json thread_object.delete(...

Mootools - why not run ?

you can test my code , when i click buton , we will get 2 link click on first link , not alert click on second link , show alert why first link not alert, how to it can alert ? <html> <head> <script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script type="text/javascript">google.load("mootools", "1.1...

Ajax GET request turning into OPTION request

I'm experiencing a weird behavior with an ajax request on a godaddy shared linux server. The request works perfectly on many other servers I've tested it on, but on this one, the GET request turns into an OPTIONS request for some reason. Here's the js code (using mootools 1.1): var a = new Ajax(myurl,{ method: 'get', ...

HTML - MOOTOOLS- Add option to select box in ie6

<select id="selectId"> <option>Please select product ...</option> </select> i try on firefox and it work $('selectId').innertHTML = '<option>Test test</option>' but on ie , it not work, how to add a option by string option like above in ie ...

Using JQuery getJSON with other JavaScripts included gives ReferenceError

I made a small example HTML page to get JQuery's getJSON method working. It looks like below (sorry for the sloppiness, this was just a proof of concept to then later add into a larger project): <script type="text/javascript"> function test() { $.getJSON("http://api.flickr.com/services/rest/?&amp;method=flickr.people.getPublicPhotos...

Using getNext() with Mootools

I'm trying to do an autocompleter in mootools 1.11. Everything works fine but i just cant check if this.selectel.getNext() is null or whatever. Firebug outputs [li] for every element and [null] for the non existing element i output via getNext(); I saw that some people are just doing: if(this.selectel.getNext()) {... but thats no...

Fade in AJAX loaded content?

var request = new Request({ method: 'get', url: 'onlinestatusoutput.html.php', onComplete:function(response) { $('ajax-content').get('tween', {property: 'opacity', duration: 'long'}).start(0).set('html', response).set('html', response).tween('height', [0, 650]); } }).send(); Before I load the desired content into...

How do I escape '+' in data I’m sending via AJAX in Mootools?

I was building a simple web based calculator which takes equations from a HTML form, evaluates it on the server using PHP and sends the result back. I am using Mootools to send the data via the req.send AJAX operation. But, each time I have a '+' in an equation, it is not seen on the POST data the server gets. Any ideas why this is ha...

Two button submit breaks other events on page (mootools).

I am wanting to use two button form and created the following which works. It however breaks any other events on the page but I can't figure out why. Is there a better way? window.addEvent('domready', function() { $('vote1').addEvent('click',function() { new Element('input', { 'type':...

Get current state (open, closed) with mootools 1.12 Fx.Slide

Hi, I'm using this Fx.Slide script in my site: var togglers = $$('.toggler'), expanders = $$('.expandable'); togglers.each(function(toggler, index){ var fx = new Fx.Slide(expanders[index]).hide(); toggler.addEvents({ click: function(e){ e = new Event(e); ...

Javascript debugging difficult as browser doesn't refresh the scripts!

Hi, I'm trying to debug a Javascript written in the Mootools framework. Right now I am developing a web application on top of Rails and my webserver is the rails s that boots WEBrick. When I modify a particular tree.js file thats called with in one a mootools init script, require: { css: [MUI.path.plugins + 'tree/css/style...

MooTools AJAX Request on unload

Hi, i'm trying to lock a row in a db-table when a user is editing the entry. So there's a field in the table lockthat I set 1 on page load with php. Then I was trying to unlock the entry (set it 0) when the page is unloaded. This is my approach. It works fine in IE but not in Firefox, Chrome etc.... The window.onbeforeunload works in a...

How to enable -webkit-animation/transition-property for :before and :after pseudo elements?

How to enable -webkit-animation for :before and :after pseudo elements? You can see in http://jsfiddle.net/4rnsx/ that it is not working for :before and :after. And here I am trying to enable this feature with Mootools http://jsfiddle.net/6bzCS/. Mozilla - will support it in Firefox 4 https://developer.mozilla.org/en/CSS/-moz-transit...

show and hide tipbox in formcheck

i am using formcheck.js (MooTools) for some input validation. what i have check input on blur and the tipbox remain until i correct its input,even i am typing in other input field. i want to change it in a way that the tipbox appears on click (on focus) on the input field and disappears on blue of that field. should i change the code or...

Opera onkeyup broken? Repeats, fires while down

When I add any onkeyup event, it does not do what it's supposed to in Opera. It fires repeatedly while the key is held, not when it's released. This same event works correctly in Chrome and Firefox. I have no listeners for keydown or keypressed. This simple code logs a stream of key events to the console in Opera when the key is held do...

How do I know what went wrong with an XHR request?

I am using mootools to send an XHR request. To a url that in other places I call using XHR is working fine. The server side does what it is suppose to do. But, I do not see any response headers. The onFailure event is being fired and the XHR object is being returned to the event handler. How do I debug this and see any kind of error mess...

Get LatLon from Google with Mootools Request.JSONP

Hi, I am trying to fetch the LatLon data from a request to Google. The Request.JSONP request works fine and returns the data perfect, but at the onSucces it returns a 'Invalid label' error. Here is my script: var G = {} var googleURL = 'http://maps.googleapis.com/maps/api/geocode/json?address='; G.google = function(id){ var addre...

Squeezbox and Mootools help

Hi I have this piece of code. It works but the problem is the second instance of a function call is not working. On Dom ready, we call a function. When user submits a form, we open the squeezbox and then call this function to update a div. here it fails. Help me fix this code. window.addEvent('domready', function() { var contai...

Does mootools provide a way to fade() all elements but one?

Mootools can fade all nodes matching a selector like this: $$('#div img').fade(0.3); I need a way to skip a particular node. In jQuery-world, I'd use a not() and it would be something like this: $$('#div img').not( oneElement ).fade(0.3); But I can't find any way to exhibit similar behaviour in mootools. Anyone know anything? ...