mootools

How do I inject javascript to a page on IE 8?

谁说我不能喝 提交于 2019-11-29 00:16:42
Lets suppose that I have the following markup: <div id="placeHolder"></div> and I have a JavaScript variable jsVar that contains some markup and some JavaScript. By using Mootools 1.1 I can inject the JavaScript content into the placeholder like this: $('placeHolder').setHTML(jsVar); This works in Firefox, Opera, and even Safari and the resulting markup looks like this: <div id="placeHolder"> <strong>I was injected</strong> <script type="text/javascript"> alert("I was injected too!"); </script> </div> However, on IE 8 I get the following: <div id="placeHolder"> <strong>I was injected</strong>

Is plain vanilla JavaScript better than using frameworks like jQuery or MooTools? [closed]

允我心安 提交于 2019-11-28 22:57:13
问题 I am wondering if it is a good idea to rely on frameworks like jQuery or MooTools or should we just use plain JavaScript? Apart from avoiding the re-invention of wheel, do they add any specific value? Since the frameworks are open to the public, can there be possibility of exploitation of any security holes that might appear (of course, unintentionally :) ) in the frameworks? Are there any other points that are to be considered when choosing a framework or otherwise? 回答1: Frameworks solve

Using JavaScript closures in setTimeout

我只是一个虾纸丫 提交于 2019-11-28 21:38:00
问题 I'm using setTimeout to emulate rendering, and I came to the structure like this: var Renderer = new Class ( { Implements: Events, initialize() { this.onRender(); }, onRender: function() { // some rendering actions setTimeout(this.onRender.bind(this), 20); } }); Does that code have potential memory leaks because of infinite nesting of closures? Or everything is ok? The only solution I came so far is to rewrite it to usual function Renderer() { var onRender = function() { // rendering

OO JQuery and classes

允我心安 提交于 2019-11-28 20:59:24
问题 I'm working on a site and using JQuery for essentially the first time. I've mostly used MooTools for previous projects, and I have a few widget classes I've written using the MooTools Class structure. I'd like to port them over to JQuery, but it looks to me like there is nothing similar to the MooTools functionality when it comes to object classes. I've searched around a bit, and haven't found much on it. Digg appears to have rolled their own, but I'm not sure if this is something I should be

What advantages does jQuery have over other JavaScript libraries?

折月煮酒 提交于 2019-11-28 20:30:58
I am trying to convince those who set standards at my current organization that we should use jQuery rather than Prototype and/or YUI. What are some convincing advantages I can use to convince them? Jahangir The 3 main advantages of jQuery are: its light weight when compared to other javascript frameworks it has a wide range of plugins available for various specific needs it is easier for a designer to learn jQuery as it uses familiar CSS syntax. jQuery is Javascript for Designers I would say my top reasons for using JQuery are: Large development community and many plugins. It's on Microsoft's

Great uploader like uploadify but with a “no-flash” fallback [closed]

為{幸葍}努か 提交于 2019-11-28 18:21:23
Is there a great uploader script that uses jQuery, like uploadify, but with a fallback option for when flash is not available? I tried FancyUpload , which has this and uses an invisible IFRAME to do its stuff. The problem is, it's built on top of Mootools (conflicts everywhere because I can't change my whole codebase to use jQuery instead of $ if I use jQuery.noConflict(), and I really don't think it's a good idea to mix js libraries like that). http://www.plupload.com/ falls back from HTML5 to Flash, Gears, Silverlight and iFrame. It's developed for TinyMCE, so it's extensively tested and

Why is jQuery so widely adopted versus other Javascript frameworks? [closed]

六月ゝ 毕业季﹏ 提交于 2019-11-28 15:03:06
I manage a group of programmers. I do value my employees opinion but lately we've been divided as to which framework to use on web projects. I personally favor MooTools , but some of my team seems to want to migrate to jQuery because it is more widely adopted. That by itself is not enough for me to allow a migration. I have used both jQuery and MooTools . This particular essay tends to reflect how I feel about both frameworks. jQuery is great for DOM Manipulation, but seem to be limited to helping you do that. Feature wise, both jQuery and MooTools allow for easy DOM Selection and Manipulation

how to implement a jQuery live bind event on mootools?

徘徊边缘 提交于 2019-11-28 09:31:55
How do I make elements that are loaded via ajax, adopt the events associated with the same class on mootools 1.11? As far as I know, in jQquery, if your ajax response consists of something like <div class='button'> , if there is an event bind using live to $('.button') , those events would automatically bind. Is that possible with MooTools 1.11? Perhaps something like this might do what you're looking for? Though I'm not sure if it'll work with 1.11. Element.implement({ addLiveEvent: function(event, selector, fn){ this.addEvent(event, function(e){ var t = $(e.target); if (!t.match(selector))

How do jQuery do its cross-domain ajax calls and how can I replicate em with mootools

谁说我不能喝 提交于 2019-11-28 09:31:00
in my eternal internal fight on whether to stay with mootools or jump to jQuery I've found on the jQuery documentation something that got my attention and this is that jQuery can ask for a JSON to a different domain, which is usually forbidden by the browser. I've seen some workarounds for cross-subdomain, but never cross-domain, and I'm really thrilled, first I thought I was server related but experimenting a little bit more I've seend that doing the very same JSON request from jQuery docs on Mootools doesn't work! This works jQuery: $.getJSON("http://api.flickr.com/services/feeds/photos

How do I track and debug JavaScript memory leaks in Firefox?

半腔热情 提交于 2019-11-28 08:22:41
I've been trying to track this one for literally a month now without any success. I have this piece of code on an car advertising website which basically allows thumbnails to rotate in search results given that a car has multiple pictures. You can see it in action at the following: http://www.abcavendre.com/4506691919/ It is built on the mootools 1.2 framework. The problem is that this script, under Firefox 3, consumes a rather large amount of memory overtime when a page is full of those rotating pictures, such as this inventory page: http://www.abcavendre.com/Vitrine/Israel_Huttman/ You can