javascript

modifying a new window using Javascript contained in the parent page

Is there a way by which a user can click on a link in a webpage, which would then trigger a new window being opened up, which is then populated with content by javascript from the original page? I need to write a self contained HTML file (so cannot use external links) that is able to BUILD a new window with predefined content... ...

UI.tabs with Superfish menu

I'm using jquery.ui.tabs to create a carousel. On the same page is a superfish dropdown menu. Everytime I'm hovering over a menu item and the tabs switch, the menu closes if it's a submenu or flickers if it's a top-level menu. See http://demos.zatechcorp.com/mm/ for an example. How do I fix this? ...

Google chrome onbeforeunload wrong behavior with iframe

Let say I have two pages. One of them contains another one inside as iframe. If you subscribe to onbeforeunload event on the parent page, then this event doesn't triggers if you close tab when iframe is in focus. I suppose it is a bug as written here: Google Chrome issues But I mentioned that, for example, google docs handle this situa...

getting a list of all descendants of an element in mootools

Hi there... suppose I have a mootools Element and I want to get a list of all it's descendants (not only direct children)... how can I do this? Thanks! ...

how to append to a object with innerHTML

Is there a way to add information to a DOM object with .innerHTML without replacing what exists there? For example: document.getElementById('div').innerHTML = 'stuff'; Would return <div id="div">stuff</div> And then a similar call: document.getElementById('div').innerHTML = ' and things'; Would set the div to <div id="div">stuff and ...

Fire tab keypress event in JavaScript?

I'm trying to simulate an actual tab key press in JavaScript. I don't want to focus on the next element or anything like that, I just want to make it seem like the tab key has been pressed. The reason why is because I am building a form JavaScript class where I want to be able to use the enter key just like tab. If someone is using a na...

Difference in jQuery with XML namespace and xhr.responseXML between Opera and Firefox

Consider this: <!DOCTYPE HTML> <html><head><title>XML-problem</title> <script src="jquery-1.3.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $('<p/>').load("text.xml", function(responseText, textStatus, xhr) { var xml = $(xhr.responseXML); var x_txt = xml.find('atom\\:x')...

How can I reference the value (or any other property) of the selected item in a CFTREE?

I have a CFTREE (format = "Flash") used to display a hierarchy of users. For the lowest level of the hierarchy, I want to open a popUpWindow using an existing JavaScript function. I've tried adding "javascript:myPopUpFunc(...)" to the href property, but it does not work. I need to pass values in the URL based on item that was clicked (i....

how to receive XML in IE8 with mootools

I'm doing a web where I heavily use AJAX requests to a XML service. In fact, my web is a front-end with almost no server whatsoever and uses AJAX to communicate with the back-end. Everything was going fine (I developed and tested in Ubuntu 9.04 and Firefox 3.0 as a browser). One day I decided to see how my web did in IE8... horror! Not...

Incrementing the CSS padding-top property in Javascript

I have a CSS defined for a div #myDiv { padding-top: 20px, padding-bottom: 30px } In a JS function, I would like to increment the value of padding-top by 10px function DoStuff() { var myDiv = document.getElementById('myDiv'); //Increment by 10px. Which property to use and how? something like.. //myDiv.style.paddingTop += 10...

How do I stop a web page from scrolling to the top when a link is clicked that triggers javascript?

When I have a link that is wired-up with a JQuery or JavaScript event such as: <a href="#">My Link</a> How do I prevent the page from scrolling to the top? When I remove the href attribute from the anchor the page doesn't scroll to the top but the link doesn't appear to be click-able. Thanks for the help! ...

jQuery Click/Change event not working properly in IE7/8

I am binding an event to a checkbox's change or click event which works fine in Firefox but in IE I have to click anywhere else (causing the blur) event before the event is fired. I have read and believe this is down to the way IE fires the events, but is there anyway I can get round it?! The whole point is that it is a smooth search f...

Object not set to instance....blah

i have radio buttons that autopostback and set panels to either visible or invisible. The entire page is in an update panel so that i can force it to update and show the invisible changes. The radio buttons are also in update panels. It works fine except for one thing - my javascript went out the window! It can't find any of my controls...

JW Player "doubling" audio in IE

I have JW player installed on our site, once on the homepage, and once on our video page. All video's work on the homepage in ALL browsers. However, on the video page, when a video is played in IE, the video starts out correctly, then about 5 - 10 seconds in, the audio portion of the file starts playing a second time, over the top of eve...

why jquery load() method doesn't require a webserver to work properly!?

why jquery load() method doesn't require a webserver to work properly , although ajax requires a web server .!!? isn't load a wrapper to simplify ajax activities? thanks :) edit: it's now clear , thank you ...

javascript (ASP.NET AJAX) refactor help - function not running

Here is the js file. The function SubmitCheck is running but when there is a state, I want to do the address check and it doesn't appear to run. What am I doing wrong? Thanks, ck in San Diego var prm = null; Sys.Application.add_init(Init); function Init(sender) { prm = Sys.WebForms.PageRequestManager.getInstance(); WireEven...

Can you put a preprocessor or TODO asp.net tag in an aspx source javscript?

I'd like to hook this so I remember to remove it if I don't wind up using it or needing it. Resharper won't pick it up because it's javascript. Even the VS2008 task list won't scrape it out of the comments. My thoughts were either a //TODO: or #warning directive, but so far I can't find anything that works and gives no errors. Sample ...

Create Object at Runtime

I have a simple factory below that I would like to simplify and not be required to modify each time I add a new object that I would like to return. In Javascript, how would I be able to create an object at runtime? Thanks switch (leagueId) { case 'NCAAF' : return new NCAAFScoreGrid(); case 'MLB' : return new MLBScoreGri...

Windows Media Player on top other DIV

I have an embed window media player which is always on top of other DIV tags. I used wmode = opaque; WindowlessVideo = -1 but it does not help. Does anyone know how to make it appear below a certain element of the page. <object type="application/x-oleobject" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" codebase= "http://activex....

Reloading flash with javascript

I have a flash file in my web page,the flash accepts a value as an argument and shows a graphics based on that. Now i want to know using javascript ,can i reload the flash ? So that when user enter a value and clicks on a button, the value will be passed to the flash file in same page and show the graphic.(without loading the page agai...