Skip to main content

Home/ javascript/ Group items tagged javascript

Rss Feed Group items tagged

Javier Neira

JavaScript setTimeout Function - JavaScript Timing Events - 0 views

  •  
    JavaScript setTimeout Function - JavaScript Timing Events November 16, 2007 by Blogging Developer JavaScript features a couple of methods that lets you run a piece of JavaScript code (javascript function) at some point in the future. These methods are: * setTimeout() * setInterval() In this tutorial, I'll explain how setTimetout() method works, and give a real world example. You may find the details of setInterval() method in JavaScript setInterval Function - JavaScript Timing Events setTimeout() window.setTimeout() method allows you to specify a piece of JavaScript code (expression) will be run after specified number of miliseconds from when the setTimeout() method is called. Syntax var t = setTimeout ( expression, timeout ); The setTimeout() method returns a numeric timeout ID which can be used to refer the timeout to use with clearTimeout method. The first parameter (expression) of setTimeout() is a string containing a javascript statement. The statement could be a call to a JavaScript function like "delayedAlert();" or a statement like "alert('This alert is delayed.');". The second parameter (timeout), indicates the number of miliseconds to pass before executing the expression. Example An alert box will be shown 5 seconds later when you clicked the button. clearTimeout() Sometimes it's useful to be able to cancel a timer before it goes off. The clearTimeout() method lets us do exactly that. Its syntax is: clearTimeout ( timeoutId ); where timeoutId is the ID of the timeout as returned from the setTimeout() method call.
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.
Javier Neira

JavaScript EE, Part 1: Run JavaScript files on the server side - 0 views

  • freedom to use the same JavaScript routines on both servers and clients. In addition, the techniques presented throughout this series will allow you to maintain a single code base for both Ajax and non-Ajax clients
  • This double-coding issue can be avoided by using JavaScript combined with Java code on the server side, getting full support of scripting languages through the javax.script API. In addition, the Java SE Development Kit (JDK) 6 already includes Mozilla's Rhino JavaScript engine, which means no setup is required.
  • the toSource() method, which all JavaScript objects must have.
  • ...5 more annotations...
  • engine.eval(scriptReader, vars);
  • sun.org.mozilla.javascript.internal.NativeObject
  • all data exchange between the Java code and the executed script should be done through primitive variables, strings, and Java objects (for example, beans) whose properties and methods can be accessed very easily in the JavaScript code. Simply said, don't try to access native JavaScript objects in your Java code. Use Java objects in the JavaScript code instead.
  • Note that javax.script.Invocable is an optional interface, which some script engines may not implement. The JavaScript engine that comes with JDK 6 does support this interface.
  • you can significantly reduce the execution time by compiling the scripts, using the methods provided by another optional interface named javax.script.Compilable, which is supported by the JavaScript engine of JDK 6.
yc c

Closure Compiler - Google Code - 1 views

  •  
    The Closure Compiler is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls.
Tim McMichael

If you need to suggest 1 site to learn Javascript, which one will it be? - 9 views

I like this topic. If everybody suggest something, then we could create a nice collection. My list: 1. Douglas Crockford javscript videos - http://yuiblog.com/crockford/ 2. Douglas Crockford javas...

javascript tutorial question

Javier Neira

JavaScript: The World's Most Misunderstood Programming Language - 1 views

  • JavaScript: The World's Most Misunderstood Programming Language
  • This is misleading because JavaScript has more in common with functional languages like Lisp or Scheme than with C or Java.
  • It has arrays instead of lists and objects instead of property lists. Functions are first class. It has closures. You get lambdas without having to balance all those parens.
  • ...1 more annotation...
  • Some argue that JavaScript is not truly object oriented because it does not provide information hiding. That is, objects cannot have private variables and private methods: All members are public. But it turns out that JavaScript objects can have private variables and private methods. (Click here now to find out how.) Of course, few understand this because JavaScript is the world's most misunderstood programming language. Some argue that JavaScript is not truly object oriented because it does not provide inheritance. But it turns out that JavaScript supports not only classical inheritance, but other code reuse patterns as well.
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.
Javier Neira

Meet the JavaScript Development Toolkit - 2 views

  •  
    Summary: The JavaScript Development Toolkit (JSDT) is an open source plug-in that brings robust JavaScript programming tools to the Eclipse platform. JSDT streamlines development, simplifies code, and increases productivity for pure JavaScript source files and JavaScript embedded in HTML.
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
Mike Chelen

JavaScript & MySQL With Jaxer - 0 views

  •  
    Wouldn't it be cool if you could work with MySQL within your JavaScript code? Think about it, you wouldn't have to spend extra time writing extra server-side code for connecting to, querying, and parsing results, you could just write a little bit more code in your JavaScript and be done with it. Of course, we wouldn't want any of this SQL exposed to the end-user, as that would be a major security issue, but what if that problem was solved as well? You might also raise the point that you'd still need the ability to prepare your SQL statements that take dynamic input to prevent SQL injection attacks, but if that weren't an issue, wouldn't that be awesome as well?
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

Javascript libraries roundup « eDevil's weblog - 0 views

Ivan Pavlov

narwhal - 0 views

shared by Ivan Pavlov on 02 Jun 09 - Cached
  •  
    Narwhal is a server-side JavaScript standard library conforming to the ServerJS standard. It is designed to work with multiple JavaScript interpreters, and to be easy to add support for new interpreters. Wherever possible, it is implemented in pure JavaScript to maximize reuse of code between platforms.
yc c

JavaScript Beautifier - Online code beautifier for JavaScript - 1 views

  •  
    JavaScript Beautifier formats JavaScript source code to make it easier to read and understand.
yc c

lazytom's FeedJumbler - work your feeds!™ - 1 views

  •  
    Convert a RSS or Atom-based feed into RSS, Atom and/or HTML and JavaScript Merge/splice several RSS or Atom-based feeds into one combined RSS and/or Atom feed Put an RSS feed (or merged feed) on your webpage using an IFrame or JavaScript)
  •  
    * Convert a RSS or Atom-based feed into RSS, Atom and/or HTML and JavaScript * Merge/splice several RSS or Atom-based feeds into one combined RSS and/or Atom feed * Put an RSS feed (or merged feed) on your webpage using an IFrame or JavaScript) Optionally, you can also register to get a personalized page where you can keep track of your merged feeds.
yc c

Underscore.js - 4 views

  •  
    Underscore is a utility-belt library for Javascript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in Javascript objects. It's the tie to go along with jQuery's tux.
  •  
    Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects. It's the tie to go along with jQuery's tux. Collections each, map, reduce, detect, select, reject, all, any, include, invoke, pluck, max, min, sortBy, sortedIndex, toArray, size Arrays first, last, compact, flatten, without, uniq, intersect, zip, indexOf, lastIndexOf Functions bind, bindAll, delay, defer, wrap, compose Objects keys, values, extend, clone, isEqual, isElement, isArray, isFunction, isUndefined Utility noConflict, identity, uniqueId, template
Javier Neira

Understanding JavaScript Timers « JavaScript, JavaScript - 1 views

  • By enforcing a timeout (however small) you remove the function from the current execution queue and hold it back until the browser is not busy.
  • you can make long running functions (on which no other immediate function is dependent) defer execution until more urgent routines have completed.
  • The firing of the setTimeout callback is asynchronous, the function itself will be invoked in line and after the current invocation queue
Julian Knight

Eloquent JavaScript -- interactive tutorial - 0 views

  •  
    Eloquent JavaScript is a digital book providing a comprehensive introduction (tutorial) to the JavaScript programming language. Apart from a bookful of text, it contains plenty of example programs, and an environment to try them out and play with them. The book is aimed at the beginning programmer ― people with prior programming experience might also get something out of it, but they should not read chapters 2 to 5 too closely, because most of the concepts discussed there will probably be nothing new to them. Do make sure you read the end of the first chapter, which has some essential information about the book itself. The book is freely available, and may be used (as a whole or in parts) in any way you see fit, as long as I am credited as the original author. A copy of the book for off-line reading can be downloaded as a zip file, and a more easily printable version can be found here.
Bartłomiej Małysz

Javascript For Designers: Getting on Your Feet Fast | Noupe - 0 views

  •  
    READ - JavaScript Tutorials
yc c

JS Bin - Collaborative JavaScript Debugging - 1 views

shared by yc c on 30 Jan 10 - Cached
  •  
    specifically designed to help JavaScript and CSS folk test snippets of code, within some context, and debug the code collaboratively. JS Bin allows you to edit and test JavaScript and HTML (reloading the URL also maintains the state of your code - new tabs doesn't). Once you're happy you can save, and send the URL to a peer for review or help. They can then make further changes saving anew if required.
1 - 20 of 458 Next › Last »
Showing 20 items per page