javascript

Loading files through goog.require in a script block fails

When using goog.require inside a <script> tag to load a script, the specified files aren't loaded. For example: <script> goog.require('goog.dom'); var mydiv = goog.dom.$('foo'); </script> Gives: goog.dom is undefined What's wrong with this usage? ...

Using the BACK button to revert to the previous state of the page

Hello I am trying a new functionality for my web site. I want to do simple navigation by hiding/showing elements. For example, when a user clicks a "details" button on some product, I want to hide the main div and show the div containing the details for the product. The problem is that to go back to the previous "page", I have to und...

javascript function return not working.

Hey, I have a problem returning a variable in my function, the below script works fine: function sessionStatus(){ $(document).ready(function(){ $.getJSON(scriptRoot+"sessionStatus.php",function(status){ alert(status); }); }); } sessionStatus(); Bet when I try the following I get a message box with the message...

How can I have an ascx postback and refresh itself automatically every X seconds?

I have an ascx control bound to a datasource with frequently changing data. Is there a quick way to have an ascx control postback, rebind and refresh itself every X seconds. The ascx control is in an update panel. ...

How to pass variable by reference in javascript? Read data from ActiveX function witch returns more than one value.

I have a ActiveX object witch I want to use in the browser (javascript). There is a function I want to call. It's prototype is: function TOPOSFiscalPrinter.DirectIO(Command: Integer; var pData: Integer; var pString: WideString): Integer; So, the function returns three values: result code, pData and pString; In javascript the functio...

Is there is reliable way to find out which revision of ECMA-262 my browser supports?

How do I find out if my browser supports Javascript 1.5 or not? using javascript of course. (or should I have googled or binged some more?) ...

XSS on jsbin.com

Anyone know if jsbin.com implements any protection for XSS or other javascript attacks? I see jsbin links used fairly regularly on sites like this one and I can't find any indication from the site one way or another. If it does implement counter measures, what kinds of things does it block out. If not, I should probably be more carefu...

multiple mousehover with jquery?

Hi there! Let's say I have a div with a backgroundimage (my logo) and I need this div to be switched with other 4 divs which are the same image but with other colours. Each image will be called on a mousehover using a jquery effect so it shows up smoothly, the order will be div1,2,3,4,5 and then restarts. An easier explanation would b...

how to stop floating (sliding) div at footer

http://stackoverflow.com/questions/225843/how-can-i-have-a-sliding-menu-div-that-doesnt-move-unless-the-page-is-scrolled-d i used the code from this link for a floating menu. it has how to stop the stop float at the header, but not at the footer. how can i modify this code to stop at the footer? //// CONFIGURATION VARIABLES: var n...

Simple problem: Safari and CSS/Javascript Rollovers.

Basically I have a bunch of IMG tags wrapped in a bunch of divs, and some javascript to make them do rollovers. The page functions beautifully in IE and in Firefox, but Safari gives: "TypeError: Result of expression 'ImageNavigateForum' [undefined] is not an object." Where ImageNavigateForum is the ID tag of the 'img'. (a simmelar err...

is it possible to know if a dijit is displayed or not?

i have two divs on a page. each has several dijits. i have atoggle that shows only one div or the other. when i submit the form, i only want to validate the dijits that are in the div that is displayed. is there a way to do this? basically, and dijits that have "display:none" should not be validated. ...

ASP.NET: Global hook in Response?

Is there any way to intercept all ASPX Page Responses? I'd like to intercept all the pages served and inject a small JavaScript at the end of each. ...

Google maps hide marker (and info) and only show when you click on an area that has info.

I want to add a transparent png into google maps instead of using the default icon. Where in my sample code would I change the default icon to a png named transparent.png? Thanks! function onLoad() { map = new GMap(document.getElementById("div_map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTy...

Hand off variable to html

So instead paying $35 for slideshowpro for lightroom, I just decided to whip up a quick javascript slideshow to do a simple task. Rotate 10 images within a div, randomly. It works like so: var imageSrc = "source_folder/"; var imageType = ".jpg"; var randomImage = imageSrc + 0 + Math.floor(#*Math.random()) + imageType; (This isn't all ...

php javascript permissions problem

Kind of a weird problem... not something ive ever run into before. So, i am using CKeditor, and am creating the upload and browse functions for users to upload and use images in the rich text editor. So, everything works great in firefox, they can upload images, and place them into the rich text editor, and save whatever they are doing ...

JQuery UI Nested List Sorting connectWith Not Working

If I nest ordered lists with the same class and connect them to each other, it's very difficult to move the list items between lists in Firefox, and in IE it's totally whacked. In order to move list items between nested list levels, I need to first drag the item totally outside the parent container. Here is a demonstration of the proble...

Handle iPhone Events (like slide-left) in Mobile Web Site

Does the iPhone browser have special events that I can hook into with Javascript? For instance, if the users slides to the left, I would like to perform a certain action. If there are events like this available, it would be nice to see a reference for all of them. ideally, there will someday be a standard for all touch-screen mobile b...

Firefox Addon Development : Detecting non-compatible addons ?

Few addons are not compatible with mine, so how to detect their presence and inform the user. Thanks ...

Javascript in a PDF?

I made up an editable PDF for students to request transcripts. Now, I want to constrain the input. For example, I want only numbers for their ID number, and I want only letters (no special characters) in the name fields, etc. In addition, there's an input called "Year Last Attended" where they enter the last academic year the user attend...

Javascript code,unterminated string literal

Error console: unterminated string literal $html='<li><div class="above">'+$question_number+ 'Question Title</div> The JQuery code is: $html='<li><div class="above">'+$question_number+ 'Question Title</div> <div class="middle"> <input type="text" name="question'+$question_number+ '" size="55"/></div> <div class="below">'+$question_nu...