javascript

cant find a reason for this bug

i just found a solution to one of the wierdest bug i have ever seen and i am still trying to find the reason ... i got a old CMs in Classic ASP. in the editor page theres a javascript changing an image property function removeimg(objimg){ objimg.onclick = ""; objimg.src = "/Logiciel/_Altitude_image/interface/Gestion_acces/space...

setTimeout in javascript question

I understand that the setTimeout function spawns a separate thread that waits for x milliseconds before executing the JS function setTimeout(functionName, timeInms); My question is if there's a way to tell it to run after the JS on the page has completed executing? Since this depends on how much JS is on the page, this cannot be an ab...

jQuery file name

This one should be easy, and I think I know the right answer, but here goes. For compatibility reasons, should I leave the filename of jQuery as "jquery-1.3.2.min.js" or just rename it to jquery.js? My guess is leave it as is to avoid conflicts in case another app uses a different version of jQuery. If they've renamed it to "jquery.js...

OnClientClick not working

I have a back and next button in that there is a OnClientClick validation function. This function is not called when i click on that, Please help me Code has given below: <asp:Button ID="btn_view1_back" runat="server" Text="Back" CausesValidation="False" ValidationGroup="Form2" /> ...

add a hash with javascript to url without scrolling page?

add a hash to url without scrolling page? with javascript i open page i scroll down i click link that adds a hash (maybe with a value #test) (example: http://www.example.com/#test) the page MUST not scroll back to the top. how can this be done? note: just checking if it's possible to disable the movement even if there is some tag wi...

Putting HTML from the current page into a new window

I want to open a new window and carry over some of the HTML in the original page to the new window. What is the simplest way to do this? Something like: $("div#foo").click( function(){ var copyHTML = $("table.bar").html(); window.open(''); // somehow put copyHTML in the new window }); ...

Adding .js files to MOSS

When I try to deploy .js files as part of a feature, not in the _layouts directory I get the following error: Cannot make a cache safe URL for 'myfile.js' Any suggestions appreciated. ...

javascript parent question

If I have a page with an iframe on it, then there is another iframe in that iframe, do I have to use parent.parent to reach the top frame or is there a shortcut to the page "root" that would be equivalent to parent.parent; or parent.parent.parent for that matter.. you get the point. ...

Javascript Counting Array of Objects

I am been having trouble counting the number of objects in this array in server-side javascript. Below is a JSON object which was parsed out using the array that I am trying to count. NOTE: The object is in object form, not JSON string form. JSON Object: [{"dataSymbol":"21135103","isHoliday":false,"isIPO":false,"lastTradeTime":400...

Is this a decent sample implementation of javascript reflection?

This is for a job interview and I'd love it if someone could put an eyeball on this and say if I'm making any big mistakes. Here was the question: 1) Assume we're developing a JS-based debugger, similar to Firebug, and we need a way to inspect JS objects and elements. Write a routing that takes an object/element as input and...

Parsing through XML returned by web service with jQuery

I'm trying to parse an XML file returned by a webservice with jQuery. Here is the code I have set up, but nothing seems to happen. $.ajax({ type: 'GET', url: 'http://www.sample.com/webservice', dataType: 'xml', success: function(xml){ console.log(xml); $(xml).find('movies').each(function(){ $(this).find('movie').each(function...

pass the e.target to a function thats called when element is clicked

I am trying to pass the clicked event (event.target) to a function inside a function that is being called when clicked how would i do this? function showGrid(){ updateTag() } function updateTag(){ /*how do i get the event.target passed here? */ alert(e.target) } $(".gridViewIcon").click(function(e) { showGrid(); }...

e4x: how to best check existence of an attribute?

I know I can do it with the length() method: >x = <a attr1='33' /> >x.@attr1 33 >[email protected]() 1 >[email protected]() 0 so I could use if ([email protected]() > 0) { .... do something .... } but is there a more appropriate way? ...

How can I trigger an onmouseover from another function?

In one function, having nothing to do with another item, how can I trigger an onmouseover event in javascript on a div with id 'item'? ...

JQuery Rounded Corners with Menu

I'd like to create a dropdown menu with rounded corners without using images. I tried combining the suckerfish menu plugin with a number of the JQuery rounded corners plugins, which mostly worked fine in Firefox, but looked terrible in IE. Does anybody have an easy combination of plug-ins that will work with both IE and Firefox? ...

YUI Datatable Column Filter

Does anyone know of any plugins/extentions to the YUI Datatable that will allow column sorting similar to how a sharepoint grid works. I'm looking for something that works/looks a bit like this from sharepoint (click on the clumn header, and a drop down appears with options to filter the datatable based on the data in that column): An...

Selective frame-busting Javascript

At some point last month, a random website decided to serve my company's website in a frame. Ignoring the question of "what are they doing?" for a minute, I used some simple frame-buster Javascript: <script type="text/javascript"> if (top.location != location) { top.location.href = document.location.href ; } </script> That part wo...

Python's __getattr__ in Javascript

Is there a way to simulate Python's __getattr__ method in Javascript? I want to intercept 'gets' and 'sets' of Javascript object's properties. In Python I can write the following: class A: def __getattr__(self, key): return key a = A() print( a.b ) What about Javascript? ...

scaling up using memcached to store gzipped file

I have a web service that serves a javascript source file to browsers. The javascript file is compiled by php in real time with some file includes. The resulting file changes only a few times a day. It is gzipped by apache before being served to browsers. I'd like to use memcached to serve it from memory to avoid disk and cpu loads of f...

Javascript calendar issue

What am I missing in my code to make display the calendar in my form. I get error object expected. C# http://www.martinesexpress-inc.com/PhoneControl/MyOrders.aspx <style type="text/css"> .style1 { width: 100%; } </style> </head> </div> <table class="style1" style="width:100%; color:black;...