javascript

how to use javascript to open a folder and list html file names in that?

I want to list the names of HTML files in a particular folder using JavaScript (in the browser)... Can anybody help me in this? Thank You ...

How to "handle" the browser autocomplete on input text ?

Hi, I have an input text login/password, i use a label which i display inside the input, when the input takes the focus, the label is hidden, when the input it is blurred if the value is not equal to "" the label is displayed again, it works great using the focus() / blur() functions, but, how could i handle the browser auto filling, b...

Why does this function work for literals but not for more complex expressions?

I am having some insidious JavaScript problem that I need help with. I am generating HTML from a JSON structure. The idea is that I should be able to pass a list like: ['b',{'class':'${class_name}'}, ['i', {}, 'Some text goes here']] ...and get (if class_name = 'foo')... <b class='foo'><i>Some text goes here.</i></b> I use the fo...

mySQL caching - Memory or Hard disk?

Hi all, I am working on a grid based treasure hunt like game in PHP , mySQL and I am trying to decide between two caching options. Game Description The user has a 1000 cell grid, clicking on some cells will have no effect, others will direct you to a "this item has been found!" page :)... many items are accessible via any of a number o...

Scrolling in JQuery

I want to scroll to a div + 100px in the y axis. How do I do that? $.scrollTo('div100' + '100px', 2000) doesn't work. ...

Javascript receives ActiveX event only once

I've written an ActiveX control using ATL. I used the wizard to add support for connection points which added public IConnectionPointContainerImpl<CActiveX> and CProxy_IActiveXEvents<CActiveX>, where the CProxy_... is the wizard generated code to fire events. I've defined a dispinterface as follows: [ uuid(43ECB3DF-F004-4FAD-...

How would one rotate an image around itself using Canvas?

I'm having trouble roating an image around itself using Canvas. Since you can't rotate an image you have to rotate the canvas: if I rotate the canvas by a degree the origin around which I want to rotate changes. I don't get how to track this change. This is my current code: http://pastie.org/669023 And a demo is at http://preview.netl...

Resize flash video player to fill the page

Hello, I have a flash video player in a div inside a webpage, I'm trying to create a button that will resize this div to fill the whole page and hide everything else behind it. Has anyone tried to do it? Problems: 1. It causes the flash to reload and the video to restart 2. In some cases a flash banner from the webpage overlays my vide...

Excluding form fields from keypress handler assigned to body

I have a keypress handler on a web page assigned to the body element. I really do want it to be active anywhere in the web page. Or so I thought. The keypress events in textual input forms also activate the body handler, which makes sense, but which I don't want. Ideally, I'd like to keep the keypress handler assigned to the body ele...

Side border and dynamic content help

I have two side borders on my website, left and right side... small image about 15x15 which repeats itself down the website... When setting 100% like below, the border only goes "one screen" down (which is 100%). But my website is dynamic and the content changes... I want the border to change along with the total height of the page... H...

Insert text on the current place of the cursor in the browser

I have a modal window which helps formatting text. I have multiple textareas on the window. The modal should not be attached to a specific textarea, so when I press an Icon in the modal window, I need to insert a string/emoticon etc where-ever the cursor is currently. My question, How do I know in which element (textarea/input/whatever) ...

create JQuery object by passing DOM object?

So, let say I have this: var d = document.createElement('div'); d.id = "whatever";` So, d is the DOM object, how can I create or convert it into jQuery object? e.g. $(d) ??? and, how to 'read' all attributes of the jQuery object? just like the var_dump of PHP. ...

Multiple markers in Googe Maps API v3 that link to different pages when clicked

I have a map with multiple markers, which I populate via an array. Each marker is clickable and should take the user to a different url per marker. The problem is that all the markers, while displaying the correct title, all use the url of the last entry in the array. Here is my code: var myOptions = { zoom: 9, center: new google.maps...

IE7 hangs on my site build in asp.net 3.5

Whenever I open a new window with javascript like this: function openwindow(){ window.open(blah blah) } on my masterpage my IE7 browser hangs.The new window is a chatroom page built in ajax controltoolkit and a music playlist for a user to listen to his/her created playlist.The problem only occurs in IE7 but ok on other browsers such ...

How can I mimic Greasemonkey/Firefox's unsafeWindow functionality in Chrome?

I'm just fiddling around with user scripts in chrome right now, so please bear with my potential ignorance/idiocy. In the page I'm writing a script for, there is a <script> element that declares a variable x. Does this mean that, in my user script, I can just access x from the global namespace? For example, if the only line in my users...

How can I find the element that fired a mouseout event in JS Prototype?

When you have a mouseover observer on an element "parent" and the event gets fired by the element "child" which is a child of "parent", event.element() returns the child. But when you have a mouseout observer on an element and it gets fired from a child element, event.element() returns only the parent. I really need to know whether the ...

regular expression for words beginning with a certain string (javascript)

I am trying to write a regular expression in javascript for finding if any words in a sentence start with a particular phrase. Eg, I'd like to know if "by" is contained at the beginning of any word in the following sentence : "The Tipping Point by Malcolm Gladwell". I tried using \b but /\bsor/ will match a sentence like 'Mary's organ ...

how to solve jquery and mootoools conflict

I use < script type="text/javascript" src="jquery-1.2.2.pack.js"> < /script> to load jquery and then load an external script that contains these : var jkpanel={ controltext: 'menu', $mainpanel: null, contentdivheight: 0, openclose:function($, speed){ this.$mainpanel.stop() //stop any animation if (this.$mainpanel.attr('...

Dojo Dialog dont want to block whole page only fragement/div of the page

Hi I am working on Dojo and Liferay portal. We have portlets which are using Dojo for UI. We want to show dialog ( "Loading..." dialog) for each of the portlets (Divs/Fragments...). Problem is each Dialog block access to whole page,and there are more than one such dialogs would be there. Can we customize/change to restrict Dojo Dialog...

Suppress line feed in <textarea> on pressing enter [html, javascript]

I want to suppress line feed in on pressing enter. Instead, I want to submit the form. I know how to submit the form on pressing enter in textarea, but I don't know to supress line feed on pressing enter. I need to hide it from user, I mean I want user not to see that enter made new line even for a moment. Thank you in advance. ...