javascript

GWT AdsManager not displaying ads on map

Here's my code: AdsManagerOptions options = AdsManagerOptions.newInstance(); options.setMaxAdsOnMap(1); AdsManager ads = AdsManager.newInstance(map, "google"); ads.setEnabled(true); I tried doing this before the map is added to a panel, after a map is added to a panel, and any other way i could think of that coul...

Getting Jquery from google

There are some tutorials which suggest to use jquery path which is from google eg: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; Is that safe to use in our projects? Aren't we dependent because we are not sure it will be there after a year or beyond? The r...

find out if something has changed in a website using an RSS feed

I need to find out if something has changed in a website using an RSS Feed. My solution was to constantly download the entire rss file, get the entries.length and compare it with the last known entries.length. I find it to be a very inelegant solution. Can anyone suggest a different approach? Details: • My application is an html file...

Invoke a Link in custom size browser

Hi, I want to have a link or something which could be inserted in an email/forum etc. It's a typical url. But I would like that link to be opened in a custom sized new browser window ( say 800 x 600 ) . It sounds weird, but that is the requirement. Can it be achieved somehow? Thanks ...

faq displaying style in Js

Hai i have implemented a js in my Faq page.... Below is the Js Code var Spry; if (!Spry) Spry = {}; if (!Spry.Widget) Spry.Widget = {}; Spry.Widget.CollapsiblePanel = function(element, opts) { this.init(element); Spry.Widget.CollapsiblePanel.setOptions(this, opts); this.attachBehaviors(); }; Spry.Widget.CollapsiblePa...

Ajax post error

Hi there. I want to post data to a web service with ajax. there is my ajax code: function Looping() { var Grid = document.getElementById("<%= gvHastalar.ClientID %>"); var Row; var Cell; if (Grid.rows.length > 2) { for (i = 1; i < Grid.rows.length - 1; i++) { Row = Grid.rows[...

How to handle 'undefined' in javascript

From the below javascript sample try { if(jsVar) { proceed(); } }catch(e){ alert(e); } this jsVar is declared and initialed in another js fine. The problem is that code throws undefined error when this code is executed before the other file (where its declared and initiated) is executed. That is why it is sur...

Javascript Compare Date and Time

Hi, I have two date time strings formated like so; 29/09/2009 15:19 & 29/09/2009 17:19 and basiclly all i want to do is compare the two date and time to see which is greater Any Help? ...

selected text position

How can I get the co-ordinates of selected text in Javascript ? ...

Javascript image uploader

How do I implement an image uploader in javascript with a crop utlility. How do u submit the image file via AJAX? Is the solution cross-domain compatible? ...

Creating a Javascript class with dynamic functions.

Let's start by saying that my code works perfectly fine, there is no problem with it. I just want to wrap it all up with a nice class for dynamic future use, and I wonder how to do that in Javascript in the most correct way. load_server is a function that puts an Ajax request. pagination() / itemlinks() are functions that go through the...

Apply style on some event to each element of html with id accordian.

Hi All. I need to do something like below. I have number of div with same id 'accordian'. now onmouseover background of the div should change to #000000. and mouseout background of that div set to #FFFFFF. I am using mootools1.2 . Below is the code which i have used, but its not workig. <script type="text/javascript" language="java...

JavaScript Array rotate()

I was wondering what was the most efficient way to rotate a JavaScript array. I came up with this solution, where a positive n rotates the array to the right, and a negative n to the left (-length < n < length) : Array.prototype.rotate = function( n ) { this.unshift( this.splice( n, this.length ) ) } Which can then be used this way...

Write breakline in HTML from JavaScript

I have some JavaScript code that does some stuff, but at some point I need to do this: $('#mySpan').text('Hello\nWorld'); Here is my HTML code: <span id="mySpan"></span> So I can finally get this: Hello World The problem is that HTML is not detecting the breakline inserted from the JavaScript. I also tried this: $('#mySpan').tex...

Handling window onclose function from flash

Hi, I have a html popup containing one flash file. Onclose of the popup I need to write some values into the socket. How can I handle the onclose event from flash ? Thanks Binoy ...

How to set jQuery datapicker current date to input tag value?

Hello, I would like to set a value to input tag on which I create a datepicker. When datepicker is initialized I want to set it. Here is an some pseudo example what I want: HTML: <input id="test" value=""></input> Javascript: $('#text').datepicker({ dateFormat: 'dd.mm.yy'}); var currentDate = $('#text').datepicker('getDate'); $('#te...

<script> inside javascript code document.write()

Hi, I got a portion of javascript code embedded in HTML (generated on the server side) that looks like this: function winWriteMail2(){ var win = open('','wininfo', 'width=400,height=300,scrollbars=yes,resizable=yes'); win.document.open(); win.document.write('<HTML><HEAD><META http-equiv="Content-type" content="text/html; charset=...

HTML/JS Debugger

We are searching for an HTML/JS debugger specifically suited for IE that can handle popup windows as well. We tested Firebug Lite which is good but it has its restrictions when compared to Firebug. We also tried IE Companion but there are some problems when it comes to in-place editing and popups. Do you recommend a good debugger? ...

get js file query param from inside it

I load this file with some query param like this: src='somefile.js?userId=123' I wrote the below function in 'somefile.js' file that reads the 'userId' query param but I feel this is not the best approach. Frankly, its quite ugly. Is there a better way? function getId(){ var scripts = document.getElementsByTagName('script'), script;...

How to find index of groups in match

When i write a regular expression like: m = /(s+).*?(l)[^l]*?(o+)/.exec( "this is hello to you" ) console.log( m ); I get a match object containing the following: { 0: "s is hello", 1: "s", 2: "l", 3: "o", index: 3, input: "this is hello to you" } I know the index of the entire match from the 'index' propert...