javascript

Header message just like at Stack Overflow

Hi, This is the first time I visited stack overflow and I saw a beautiful header message which displays a text and a close button. The header bar is fixed one and is great to get the attention of the visitor. I was wondering if anyone of you guys know the code to get the same kinda header bar. Would appreciate any help!! Thanks ...

What does this expression mean: "javascript:{}"

I have a sample application which has something like below. <a href="javascript:{}" id="anchorlnk">Go</a> which javascript function does the link call? ...

Getting the previous month's first date from current date in JavaScript

Please anyone share the code to find the previous month's first date from current date in JavaScript. For example, if the current date is 25th Jan 2009, I should get 1st Dec 2008 as result. Duplicate of: http://stackoverflow.com/questions/605113/find-first-day-of-previous-month-in-javascript ...

hi i need to erase a certain session variable from javascript

hi i need to erase a certain session variable from a javascript function how can i do this can anybody help me? ...

RichTextEditor that is PHP/code friendly to snippets of php

I can't seem to find a js RTE that will play friendly with snippets of php intertwined in it. I want a mini CMS for the backend of a number of sites. The views have some snippets of php here and there Are there any RTE's that will leave the php alone, and even show it mixed with the nice formatting? TinyMCE kills the tags even when...

What are the best JavaScript implementations of a gallery?

We need to implement a gallery feature for our client's new website. They had a similar feature on their last site, which used Smooth Gallery, which in turn was based on Moo Tools. We could go ahead and do the same however, before we do, does anyone have any suggestions for alternatives and if so, please explain why you feel your choice...

drag an drop multiple items along with IDs using javascript

Hi All, I need a javascript for drag and drop multiple items along with the item ID and the ID where item is dropped on. It should support both IE and Mozilla. Thanks & Regards Khushi ...

How to use google maps API with multiple markers on the same map

So, i have the following script to use the google maps API, its all fine, but i need to create a map that has more than one Marker (the balloon shaped icon pointing to something) and i need each of those markers to point on a different area of the map (i.e. different coordinates), how can i do it? <script type="text/javascript"> ...

Have asp.net-mvc generated urls in included javascript file?

My asp.net-mvc view has an included javascript file. This javascript file has the following line: $("input[id='SearchBag.CompanyName']").autocomplete("Search.mvc/AutoComplete/"); This works. Great. But it would be even better if I could replace the autocomplete's path with a generated URL so if I change the routing paths, I won't have...

javascript not being called

Hello, I have the following javascript functions, which when in a standalone file, will be called correctly from a page. function deleteItem(layer, url) { var xmlHttp=GetXmlHttpObject(); if(xmlHttp==null) { alert("Your browser is not supported?"); } xmlHttp.onreadystatechange = function() { if(xmlHttp.readyStat...

Formatting the Date in JavaScript

Using newDate() function in Java script, I am able to get today's date. I am getting the date in the format 3/3/2009 (d/m/yyyy). But i actually need the date in the format 2009-03-03 (yyyy-mm-dd). Can anyone pls let me know how to format the date as i require? ...

Expand a link to show image without using javascript

Hi. I have a page with some text and links. I want to display image there itself on clicking those links. However, I am bound of not using javascript at all. All I can use is some server side component like PHP. Thanks ...

Javascript PrintScreen

Hi All, Javascript from client side. That is the window.clipBoard in javascript i got some documents where text copied to clipboard is got and shown. I want the to implement the "PrintScreen" functionality over a web application. Any help wold be appreciated. Thank you ...

element not being removed from DOM

I have code to delete a record from mysql, displayed in a table via php, and subsequently delete the table row from the page. The record is deleted, however nothing changes in the page or the DOM, and it should change instantly. Here is the javascript code to delete from the DOM function deleteItem(layer, url) { var xmlHttp=GetXmlH...

Is there a cross browser way of setting style.float in Javascript?

Usually, if you need to set a style attribute in JavaScript, you say something like: element.style.attribute = "value"; There are slight variations but usually the attribute name is a similar, albeit camelcased, version of the HTML attribute name. The problem for me is that the float attribute doesn't work. Float is a keyword in Jav...

Multiple Markers on a Google Map

I added a google map with two markers (i am just testing), the code is: function load() { var map = new GMap2(document.getElementById("map")); var marker = new GMarker(new GLatLng(<%=coordinates%>)); var marker2 = new GMarker(new GLatLng(31.977211,35.951729)); var html="<%=maptitle%><br/>" + "<%=text%>"; ...

JavaScript lib for google maps or live maps

Can anyone recomend a good javascript lib for working with Google Maps or Live Maps(virtualearth )? Is jQuery og Prototype something to consider? I think I remember that asp.net ajax had some controls and hooks for working with virtual earth back in the day, but cant seem to find it any more. Cheers ...

self-invoking functions

Hi, when I code: var a = function() { alert("44") return function(){alert(33)} }()(); is this expression evaluated in the following order? define the function; pass its reference pointer to a a() is invoked return in a a new function pointer a() is invoked again and if so why do I have a syntax error if I do: function() ...

Text Input with descriptive text

Hello, I was wondering if there's an easy way with javascript (including JQuery, which we're using on the site) to put descriptive text in a text input until the user clicks it to type in their own text. For instance I'd like to put the word 'Search' in a text input (preferrably in a lighter color than real input) until the user click...

Java equivalent to JavaScript's encodeURIComponent that produces identical output?

I've been experimenting with various bits of Java code trying to come up with something that will encode a string containing quotes, spaces and "exotic" Unicode characters and produce output that's identical to JavaScript's encodeURIComponent function. My torture test string is: "A" B ± " If I enter the following JavaScript statement i...