javascript

Divide a div element

Hi, Is there a way to cut a div into number of pieces using JavaScript or CSS. I have a long div with contents inside it. I need to split the div according to a certain height and show each division as a separate block. What is the easiest way to achieve this? Suppose the height of the main div is 1500px. I need to split the div into 3 ...

Javascript Not Populating Dropdown in Webbrowser Control C#

Hi, there is this classic asp site that is using javascript to populate dropdowns or whatever they called it back then. Well, if I goto this site from the regular browser after a second it fills the dropdown with the data. But in the webbrowser control no such luck almost like Javascript is disabled. For those interested in the sites s...

browser fullscreen window.fullScreen=true not working

Hi, I would like to open my html page in fullscreen mode. I tried to execute this javascript in body's onload event handler. window.fullScreen = true; But unfortunately that doesn't seem to be working. Is there any other way with which we can achieve the same. Thanks, Shafi ...

JQuery thickbox with iframe. Set focus to input field

Hi I had a jquery thickbox modal popup on my application. (iframe) Everything works great but I want to set the focus to a specific input field. The Iframe loads a normal aspx page so I thought I'd do a $(document).ready(..focus); I put that script in the IFrame code However this does not work. I believe that after the "ready" some o...

Variables as properties in JavaScript

Consider this code: <script type="text/javascript"> if ('mySuperProperty' in window) { alert(window['mySuperProperty']); } var mySuperProperty = 1; </script> Condition in if statement evaluates to true even though mySuperProperty isn't set yet. Why? Update: Changed title, added <script> tag. I stole this question from h...

How to avoid 'null' strings when binding JSON data on client side

Is it possible to avoid having 'NULL' stings on the client when binding JSON data to HTML UI? I'm using ASP.NET MVC + jQuery + jTemplates. Data is coming from linq-to-sql classes and these classes have quite a lot of nullable properties. When such properties get serialized and transferred back to client I end up with such JSON: [{"Id":...

Loading message

Searching for a js script, which will show some message (something like "Loading, please wait") until the page loads all images. Important - it mustn't use any js framework (jquery, mootools, etc), must be an ordinary js script. Message must disappear when the page is loaded. ...

Javascript popup window doesn't gain focus after first load in Firefox

Hi, Easiest way to explain should be this example http://www.massimofidanza.it/firefox . This works correctly (popup is focussed again) only on IE. Is there any workaround (without closing and opening a new popup)? update: option for javascript to raise popup windows is enabled. ...

Javascript XML parsing

Hi there, What is the best JavaScript library to parse XML/RSS/Atom feeds? Is there something like Python Feed parser but then for JavaScript ? thanks, Pero ...

asp.net tree view selectd node value using javascript

hi i am using a treeview control in my page i am binding the treeview with the datatable i need to use javascript to get the selected node value on the tree in a button click. how to do this ...

Using JavaScript / ActionScript to monitor browser windows from the same domain

My webpage loads a background flash which will connect to the server using socket. If a user open multiple windows/tabs of my website, the server will get multiple socket connections. Any idea of how to make sure that only one socket is connected from the same user and same browser? I am thinking of using Javascript to monitor the wind...

How do I write a jquery function that accepts a callback as a parameter

I Have the following function. function ChangeDasPanel(controllerPath, postParams) { $.post(controllerPath, postParams, function(returnValue) { $('#DasSpace').hide("slide", { direction: "right" }, 1000, function() { $('#DasSpace').contents().remove(); $('#DasSpace').append(returnValue).css("displ...

force google gadget rss tabber open link in new window

i'm using google gadget "rss tabber" http://www.gmodules.com/ig/creator?synd=open&amp;url=http%3A%2F%2Fclingman.org%2Fplatypus%2Fcustomized-rss-feeds.xml&amp;lang=en I tried to use jquery to force all the link to open in new window but failed. anyone got suggestion how to do this ? force all the link to be open in new windows? $('...

What is the consequence of this bit of javascript?

Hi, I was looking at jQuery UI code, and I found that every file starts with a construct like this: ;jQuery.ui || (function($) { My question is: why is there a semicolon before jQuery, and why is the logical OR being done? jrh ...

Prevent user from accidentally navigating away

My problem is a bit more complex than using the following simple JavaScript code window.onbeforeunload = function (e) { return 'Are You Sure?'; }; On an e-commerce web page I would like to remind the user that he has items in the shopping cart so that he can change his mind before closing the browser tab/window navigating to...

Is there a way to tile a background image over a canvas path?

For example, I have a canvas in a page with some kind of a path. It is created by javascript this way: var context = $('#some_canvas').getContext('2d'); context.beginPath(); context.lineWidth = 5; context.strokeStyle = '#000000'; context.moveTo(0, 0); context.lineTo(100, 100); context.stroke(); Is there a way to make the path that app...

Visibility option in jquery

I'm having some trouble with finding the visibility param for JQuery. Basically... the code below does nothing. $('ul.load_details').animate({ visibility: "visible" },1000); There's nothing wrong with the animate code (I replaced visibility with fontSize and it was fine. I just can't seem to find the correct param name equivalen...

Is it possible to get files from two different servers using HTML or javascript

Hi All, Is it possible to get files from two different servers using HTML or javascript, Lets say File A is in Server A and File B is in Server B.Is it possible to access both the files and display them EDIT: pls post some code ...

Will HTML5 allow web apps to make peer-to-peer HTTP connections?

This is probably a dumb question, but I have to ask it anyway. I'd like to know if it is at all possible to create a web app that, with the help of a central server, could create direct connections with other users of the same web app. I'm imagining a process similar to UDP hole punching. I've read about the new WebSockets API in HTML5,...

What is the best way to inject HTML into the DOM with jQuery?

Hi, I'm working on a calendar page that allows a user to click on a day, and enter an entry for that day with a form that pops up. I'm no stranger to DOM manipulation with jQuery, but this is something I've done before and I'm beginning to wonder if there's a more efficient way to do this? Would building the HTML manually within JavaS...