Skip to main content

Home/ javascript/ Group items tagged ie

Rss Feed Group items tagged

yc c

Bookmarklet Coding › Left Logic - 0 views

  • if you want your bookmarklet to work in all browsers, it has to adhere to length limits: IE 5 - 2084 bytes IE 6 - 508 bytes IE 6 SP 2 - 488 bytes IE 7 - 2084 bytes Firefox + Safari - > 2000 bytes IE6 has the smallest length, and that includes the javascript: pseudo protocol.
  • Avoid the double quote character ("). Since the user is going to install your bookmarklet from a link, it will be wrapped with quotes (assuming xhtml). If you absolutely require quotes, try using the entity: %22
  •  
    if you want your bookmarklet to work in all browsers, it has to adhere to length limits: * IE 5 - 2084 bytes * IE 6 - 508 bytes * IE 6 SP 2 - 488 bytes * IE 7 - 2084 bytes * Firefox + Safari - > 2000 bytes IE6 has the smallest length, and that includes the javascript: pseudo protocol.
Ivan Pavlov

John Resig - DOM DocumentFragments - 0 views

  • var div = document.getElementsByTagName("div"); var fragment = document.createDocumentFragment(); for ( var e = 0; e < elems.length; e++ ) {         fragment.appendChild( elems[e] ); } for ( var i = 0; i < div.length; i++ ) {         div[i].appendChild( fragment.cloneNode(true) ); }
  • Setting some time stamps we can see our results pay off in spades: Browser Normal (ms) Fragment (ms) Firefox 3.0.1 90 47 Safari 3.1.2 156 44 Opera 9.51 208 95 IE 6 401 140 IE 7 230 61 IE 8b1 120 40
Javier Neira

How To Make Firebug's JavaScript Debugger Break Inside Dynamic JavaScript Using The 'de... - 0 views

  • The Problem With Dynamic JavaScript However, what if the JavaScript file where you need to set breakpoints is not static but instead dynamic (generated on the fly). If you set a breakpoint in this case and reload the page, the breakpoint will most likely disappear, especially if the JavaScript url is generated uniquely every time. The Solution If you have access to the source, the solution comes in the form of the debugger; keyword. Just add it to your dynamic JavaScript generator or into any JavaScript file you have access to exactly where you want Firebug to break, and voila – it does.
  • More so, this method also works in Google Chrome and IE (if you have Microsoft Script Debugger)
  •  
    The Problem With Dynamic JavaScript However, what if the JavaScript file where you need to set breakpoints is not static but instead dynamic (generated on the fly). If you set a breakpoint in this case and reload the page, the breakpoint will most likely disappear, especially if the JavaScript url is generated uniquely every time. The Solution If you have access to the source, the solution comes in the form of the debugger; keyword. Just add it to your dynamic JavaScript generator or into any JavaScript file you have access to exactly where you want Firebug to break, and voila - it does.
Mohammed GHERAÏSSA

Raphaël: a JavaScript API for SVG - Opera Developer Community - 0 views

  •  
    Opera Developer Community article: Raphaël: a JavaScript API for SVG" />Raphaël: a JavaScript API for SVG - Opera Developer Communitytext/css
qualitypoint Tech

CSS - Workaround for max-width property in IE6 |QualityPoint Technologies - 0 views

  •  
    Max-width is the property used for limiting the width of the image to predefined value. So it will help to show small sized pictures to display in their original size while resizing the large-sized images into a predefined maximum width.
yc c

Color Picker - Raphaël - 0 views

shared by yc c on 04 Mar 10 - Cached
  •  
    No images. No libraries*. Works even in IE6. // Color Picker by Raphaël - raphaeljs.com var icon = Raphael("picker", 23, 23).colorPickerIcon(11, 11, 10); icon.attr({cursor: "pointer"}).node.onclick = function () {    document.getElementById("benefits").style.visibility = "visible";    var out = document.getElementById("output");    out.style.visibility = "visible";                   // this is where colorpicker created    var cp = Raphael.colorpicker(document.body.offsetWidth / 2 - 150, 250, 300, "#eee", document.getElementById("picker2"));                   out.onkeyup = function () {        cp.color(this.value);    };    // assigning onchange event handler    cp.onchange = function (clr) {        out.value = clr;        document.body.style.background = clr;        document.body.style.color = Raphael.rgb2hsb(clr).b s it. Too easy                    icon.node.onclick = null;}; 
yc c

Cross Browser Copy To Clipboard - 1 views

  •  
    This has been tested with Firefox 3.5.5, IE 8 (8.0.6001.18702), Google Chrome 3.0.195.33, and Safari (Win) 4.0.4 (531.21.10). For web spiders, no content is hidden from them so it matters not whether they support Flash or JavaScript.
Julian Knight

Jash: JavaScript Shell - 4 views

  •  
    "Jash is a DHTML-based window that gives you command-line JavaScript access to the current browser window. With this console you can quickly debug scripts, manipulate the DOM, view the current page's objects, functions, and variables, execute arbitrary Javascript, enter new CSS (in IE, Firefox, Opera, and Safari), and much more." - A useful tool to execute JavaScript, make live (temporary) CSS changes to a page, discover the page structure, etc. for developers. Written totally in JavaScript so can be used on any platform with any browser. Include in your own pages for debugging or load via a bookmarklet to run on any page.
Ivan Pavlov

NitobiBug - Browser based debugger - 0 views

shared by Ivan Pavlov on 06 Jun 08 - Cached
  • It's a browser-based JavaScript object logger and inspection tool - similar to Firebug. NitobiBug runs across different browsers (IE6+, Safari, Opera, Firefox) to provide a consistent and powerful tool for developing rich Ajax applications.
Ivan Pavlov

joose-js - Google Code - 0 views

  • Joose is a self-hosting meta object system for JavaScript with support for classes, inheritance, mixins, traits, method modifiers and more. Joose makes object-oriented programming with JavaScript easy, declarative and very productive. The Joose meta-object system is multi-paradigm. It supports class-based and prototype-based programming styles as well as class-based inheritance and role-based extention. The Joose framework has been successfully used in multiple production systems for twelve months now and has been proven to be very stable. Joose is being tested using an automated unit-test suite that is being run in all major browsers (Firefox, IE, Safari, Opera and Chrome).
Julian Knight

slayeroffice | Favelet Suite - 0 views

  •  
    Some of the very best web development favelets available including MODI and DOM inspector
Julian Knight

mrclay.org » Blog Archive » MyPage Bookmarklet - 0 views

  •  
    Bookmarklet that lets you delete and change elements on page beforeprinting. Also does a fast print preview. Very powerful.
  •  
    Bookmarklet that lets you delete and change elements on page before printing. Also does a fast print preview. Very powerful.
yc c

JavaScript Shell - 0 views

  •  
    Features: You can enter statements and expressions at the same prompt. The result of each non-void statement or expression is shown. User-defined variables. b = document.body User-defined functions. function f() { return 5; } JavaScript error messages are shown in red. Previous statements and expressions are available through Up and Down arrow keys. Tab completion. Multiline input (Shift+Enter to insert a line break). If the shell is opened using a bookmarklet, JavaScript typed into the shell runs in the context of the original window. Works well in Firefox, mostly works in Opera 8 and in IE 6 for Windows. Suggested uses: Test short bits of JavaScript, bookmarklets, or user scripts. (For longer bits of JavaScript, try the JavaScript development enviornment too.) Explore DOM objects such as document.body using props (Alt+P) to figure out what is possible. Explore the DOM of a specific page using the bookmarklet version of the shell. Modify the DOM of a specific page using the bookmarklet version of the shell. Use the shell like you would use the home screen of a calculator such as a TI-83. Alt+M gives you easy access to math functions such as sin and pow.
Julian Knight

Automatically Configure Browsers for Proxy - 0 views

  •  
    How to set up autoconfigure scripts for various browsers that need to work on different networks/proxies (PROXY.PAC files).
Ivan Pavlov

oni - structured concurrency - 0 views

  • Oni is a framework for managing the control flow of concurrent applications. There are two central ideas to Oni: To make concurrent actions composable by implementing 'pseudo-sequential' control structures with which asynchronous actions can be choreographed in the same way in which traditional sequential control structures are used to choreograph conventional synchronous actions. Ok, I'm not sure I even understand that myself. But please read on anyway :-) To leverage the facilities of a "host language" rather than implement a complete programming language from scratch. Oni can be implemented as a set of functions ("Oni operators") in a suitable host language, such as JavaScript or C++ (any reasonable language will do). Our current implementation, dubbed Oni/JS, is in JavaScript, targeted at in-browser use (should work in any modern browser - FF, Chrome, Safari, IE, ...). Oni requires no preprocessing or precompilation; an Oni program is a just an expression in the host language.
  •  
    Oni is a framework for managing the control flow of concurrent applications.
Javier Neira

Perfection kills » Understanding delete - 3 views

  • All because it’s not possible to delete variables in Javascript. At least not when declared in such way.
  • It’s almost as if Firebug follows some other rules of deletion. It is Firebug that has led Stoyan astray! So what is really going on here?
  • we need to understand how delete operator works in Javascript: what exactly can and cannot be deleted and why.
  • ...35 more annotations...
  • var o = { x: 1 }; delete o.x; // true o.x; // undefined
  • var x = 1; delete x; // false x; // 1
  • function x(){} delete x; // false typeof x; // "function"
  • Note that delete only returns false when a property can not be deleted.
  • variable instantiation and property attributes
  • Global code, Function code and Eval code.
  • When a source text is treated as a Program, it is executed in a global scope, and is considered a Global code.
  • Anything that’s executed directly within a function is, quite obviously, considered a Function code. In browsers, content of event attributes (e.g. <p onclick="...">) is usually parsed and treated as a Function code.
  • text that’s supplied to a built-in eval function is parsed as Eval code. We will soon see why this type is special.
  • And now that we know the difference between property assignment and variable declaration — latter one sets DontDelete, whereas former one doesn’t — it should be clear why undeclared assignment creates a deletable property:
  • As you can see, execution contexts can logically form a stack. First there might be Global code with its own execution context; that code might call a function, with its own execution context; that function could call another function, and so on and so forth. Even if function is calling itself recursively, a new execition context is being entered with every invocation.
  • Every execution context has a so-called Variable Object associated with it. Similarly to execution context, Variable object is an abstract entity, a mechanism to describe variable instantiation. Now, the interesing part is that variables and functions declared in a source text are actually added as properties of this Variable object.
  • When control enters execution context for Global code, a Global object is used as a Variable object. This is precisely why variables or functions declared globally become properties of a Global object:
  • The behavior is actually very similar: they become properties of Variable object. The only difference is that when in Function code, a Variable object is not a Global object, but a so-called Activation object. Activation object is created every time execution context for Function code is entered.
  • and a special Arguments object (under arguments name). Note that Activation object is an internal mechanism and is never really accessible by program code.
  • within Eval code are created as properties of calling context’s Variable object. Eval code simply uses Variable object of the execution context that it’s being called within:
  • Execution context When ECMAScript code executes, it always happens within certain execution context.
  • When declared variables and functions become properties of a Variable object — either Activation object (for Function code), or Global object (for Global code), these properties are created with DontDelete attribute. However, any explicit (or implicit) property assignment creates property without DontDelete attribute. And this is essentialy why we can delete some properties, but not others:
  • Special arguments variable (or, as we know now, a property of Activation object) has DontDelete. length property of any function instance has DontDelete as well:
  • As you might remember, undeclared assignment creates a property on a global object.
  • Now that it’s clear what happens with variables (they become properties), the only remaining concept to understand is property attributes. Every property can have zero or more attributes from the following set — ReadOnly, DontEnum, DontDelete and Internal. These attributes serve as sort of flags — an attribute can either exist on a property or not. For the purposes of today’s discussion, we are only interested in DontDelete.
  • Variables declared within Eval code are actually created as properties without DontDelete:
  • This interesting eval behavior, coupled with another aspect of ECMAScript can technically allow us to delete non-deletable properties. The thing about function declarations is that they can overwrite same-named variables in the same execution context:
  • Note how function declaration takes precedence and overwrites same-named variable (or, in other words, same property of Variable object). This is because function declarations are instantiated after variable declarations, and are allowed to overwrite them
  • If we declare function via eval, that function should also replace that property’s attributes with its own. And since variables declared from within eval create properties without DontDelete, instantiating this new function should essentially remove existing DontDelete attribute from the property in question, making that property deletable (and of course changing its value to reference newly created function).
  • Unfortunately, this kind of spoofing doesn’t work in any implementation I tried. I might be missing something here, or this behavior might simply be too obscure for implementors to pay attention to
  • this.x = 1; delete x; // TypeError: Object doesn't support this action
  • var x = 1; delete this.x; // TypeError: Cannot delete 'this.x'
  • It’s as if variable declarations in Global code do not create properties on Global object in IE.
  • Not only is there an error, but created property appears to have DontDelete set on it, which of course it shouldn’t have:
  • “The global variable object is implemented as a JScript object, and the global object is implemented by the host.
  • Note how this and window seem to reference same object (if we can believe === operator), but Variable object (the one on which function is declared) is different from whatever this references.
  • delete doesn’t differentiate between variables and properties (in fact, for delete, those are all References) and really only cares about DontDelete attribute (and property existence).
  • The moral of the story is to never trust host objects.
  • Few restrictions are being introduced. SyntaxError is now thrown when expression in delete operator is a direct reference to a variable, function argument or function identifier. In addition, if property has internal [[Configurable]] == false, a TypeError is thrown:
1 - 18 of 18
Showing 20 items per page