javascript

Create a range or html fragment in IE from a string

How do I take a string and create an html fragment with it in IE. This works fine in non-ie browsers. var str = "<div>Foo</div>"; var range = document.createRange(); var frag = range.createContextualFragment(str); var e = document.getElementById("element"); e.appendChild(frag); ...

How do I get HTML corresponding to current DOM tree?

jQuery("html").html() seems to retrieves most of it, except for the wrapping tag. DOM is heavily modified, so original source is of not that much use. Is it reliable? Is it a good idea to just take jQuery's output and wrap ... around it? I can see at least some doctype problems here, and inclusion of scripts which shouldn't be rerun....

How to find Javascript syntax errors

I am writing a JavaScript section of code and am making huge amounts of silly mistakes in the syntax. But the only way to find what line the error is on is to start commenting out the section of code I just wrote and reload it into the browser to narrow down where my missing ');' is. How do you "compile" a JavaScript source to make sur...

Do you know any Javascript or Flash open source library to generate financial OHLC charts?

I've looking for a library that could generate this kind of graphics, but the only one that seems able to do it is JFreeChart (for Java), maybe someone else faced the same problem but in Javascript or Flash. By the way, this is an example of the chart that I'm looking for: http://www.brighthub.com/money/investing/articles/33137.aspx?ima...

Header printing on every page.

I have a gridview that i want to print its header on every page and i want to print a page header on every page. The problem is that one or the other works for me. I can't get both to work at the same time. Below is sample code to show what i've done. <table> <tr> <td> <body onload="thead('tblheader');"> <table id="tblheader">...

How can I make use of a JavaScript variable across two separate functions?

I have the following jquery function $(function(){ $('.buttonEffectWrapper a').not('#browse-all a').hover(function(){ pauseResume(); var imageBrowserContent = $('#mainImageBrowser').html(); $('#mainImageBrowserTabButtonWrapper, #slideshow > div') .animate({opacity:"0"}, {duration:250}); ajaxFunction('footer');...

Get artist name and song name by YouTube code

Hi, On my website, people are able to drop their YouTube code link Like faXwJ9TfX9g How do I get the name of the artist and name of the song, with a simple Javascript. Input : faXwJ9TfX9g by User Output : Name of artist Output : Name of the Song Output : Length of the Song Best regards, Simon Buijs Zwaag Netherlands ...

How to pass dymanicaly generated reults into a print friendly new window

So I have a quiz users take, and at the end they obviously get results. There is a "Print Results" feature which the client wants to load into a new window with new css etc... My question is, how do I pass the results to a new window using javascript? Normally I would do this all with session, but the quiz and results were all done wi...

InDesign Scripting: Need to export INDD file as INX (INDX).

I'm working with InDesign CS4 and CS3. Both need to export their files down to CS2. I'd like to use a .jsx code snippet to export to INDX, but I can't seem to do-so with the ExportFormat."formatName" JS code. Doesn't look like Adobe supports exporting to INDX from javascript - perhaps using a plugin (but that's a lot of overhead for a si...

HTML 5 SQLite: Multiple Inserts in One Transaction

Is it possible to do something like this: begin; insert into some_table (some_col, another_col) values ('a', 'b'); insert into some_table (some_col, another_col) values ('c', 'd'); ... commit; ...in HTML 5? With each transaction being async and having it's own callback, seems to me that it would be difficult to write a ro...

Javascript browser Bookmarklet

I have the following javascript bookmarklet which opens a new popup window with a facebook post page in side of it. javascript:var d=document,f='http://www.facebook.com/share',l=d.location,e=encodeURIComponent,p='.php?src=bm&amp;v=4&amp;i=1261526047&amp;u='+e(l.href)+'&amp;t='+e(d.title);1;try{if (!/^(.*\.)?facebook\.[^.]*$/.test(l.ho...

2 Books: Head First Javascript vs. Javascript The Defenitive Guide

I want to start learning javascript from Scratch (beginner) so I tried to find the best book for that but I am now confused! I have found 2 books and both of them has a very nice reputation. The first book is O'Reilly Javascript, The Definitive Guide, 5th edition. The second book is O'Reilly Head First Javascript I don't really know...

Testing Internet connectivity problems such as hangs and timeouts with Javascript

I have a web app that I provide to small to medium-sized businesses as a service. Most of the support calls I get concerning speed issues end up being caused by problems on my clients' networks. I would like to be able to point them to a specific web page that will run an x-minute test where multiple HTTP requests would be made via Jav...

Javascript, aliases and IE

In an attempt to save space, I made a whole bunch of aliases for functions in my code. It works fine in FF, but now I'm trying to add support for IE and it's not happy. j=String; f0=j.fromCharCode; j=j.prototype; j.f1=j.indexOf; j.f2=j.lastIndexOf; j.f3=j.concat; j.f4=j.substring; function alias(c,e){return function(){return c[e].apply...

Jquery autocomplete with jquery 1.4

Hello everybody, Referring to this post and this one. I'm trying to implement tag search for my blog/website something similar to SO tag system using jquery autocomplete plugin, I'm using jquery 1.4 latest version so I'm not sure whether it works with it or not, I've used this plugin before once. So without further jibr-jabr here is my ...

Javascript: Automatically maximize browser window and switch to full screen mode?

Hi, I am working on a Flash app that is 900x700 pixels. When viewed in misc. browsers at 1024x768, the browser chrome causes robs too much of the vertical space and the app appears in a window with a vertical scrollbar. Unacceptable. The flash app will be launched via a link emailed to the viewers. I'd like to avoid resizing the flash ...

how to add a var to href

well what is needed is something like var link = " http://www.google.com"; < a href= 'link' /> or something like it . so i need to use a var as a href ? anyway to do such thing ? forgot to mention iam using it under mozilla jetpack - html : "" tag it worked with "< a href= ' " + link + " ' /> anyone has a better way ? ...

How can I improve my sites IE6/7 JS performance?

Hi folks, So I was involved in a site rewrite recently and we've gone live with what’s a big improvement on the previous in every way (no it's not perfect, we live by deadlines and are always improving :D) with one exception: in IE6/7 it will lockup after the page has shown. I know it's the JS as with it disabled it's fast and I'm aware...

How can I make the Raphael Import plugin (http://github.com/wout/raphael-svg-import) support gradients?

Hi! I was wondering if its possible to render gradients using the import-plugin for RaphaelJS. Import tool: http: //github.com/wout/raphael-svg-import Or is there a script (PHP) I could use to make a path string I could use with raphael. I have a AJAX interface I can use if there is a PHP solution for this. Currently the import tool ...

Interacting with a verified location? - Google Maps

Ok so there are loads of Businesses marked on Google Maps these days. But I cannot interact with these in any way. This is the information I have: venue name: Ministry of Sound address: 103 Gaunt Street London, SE1 6DP Google's Geolocation only gives me Coordinates (lat, long) Formatted Address I want an application ...