javascript

JQuery blur event

I have a text area and a "add" button on a form. By default the text area is shown as shrinked and grayed out. On focus it will be highlighted by changing the style. On blur it should go back to previous state. Along with highlighting the textarea, add note should toggle as visible and hidden. The problem is when i enter the data in text...

Traversing to a specific child element with Prototype

Given the following markup. <div id="example"> <div> <div> <input type='hidden'></input> </div> </div> </div> How can I quickly get the hidden input element given I have the ID for the top most div element with the ID 'example'? I can hack away at it so I can just iterate through each child element until I hit the...

Fill out a form on click?

What would be the best way to fill out a form on an html page when someone clicks a link. The best example i can think of is on *chan sites, where a user clicks on the ID of a comment and that ID is then inserted into the comment Text Area. ...

Why does HTML 5 not have editable combobox or local menus built in?

I was wondering, in the new HTML 5, we will get <audio> and <video> tags, but why not native editable combobox and built in local menu support? The reason I'm asking this is because these are the most common problems I face when I have to design a web solution to a typical table based application (e.g. order management app). On a proper...

Given this script, how can I place the submenu to the left of the main menu?

Hi see this script please: <style> .rightnav_menu { width: 152px; height: 294px; direction: rtl; text-align: right; clear: both; margin: 0px; float: right; background-color: #cae9eb; } .rightnav_menu ul { margin: 0; padding: 0; list-style-type: none; font-family: Tahoma, Geneva, sans-ser...

How do I create a new line using javascript that shows correctly in notepad?

I have a script that copies table cells from the browser into the user's clipboard. I loop through each cell and when a new line is needed I use text += "\n"; If I paste the text into excel, it formats correctly and fills in the proper rows, however if I paste into notepad, it shows a symbol instead of creating a new line: 123□456□78...

calling fancybox using jquery .click function

I am trying to customise fancybox so that when one of the 4 images displayed on the page is clicked, this is the one that loads up in the fancybox window. To do this I want to use the jquery .attr function to pass the image src (as a variable) to the main image holder. My current jquery code is: jQuery(document).ready(function($) ...

convert english to arabic

Hii,i m building a chat application.How to convert english to arabic and display in arabic language.please help. ...

Bracket Highlighting in Textmate (javascript)

I have some gnarly functions in javascript that I am using Textmate to edit. I see an extremely short flash of the matching bracket, but it is almost imperceptible if you don't arrow over the bracket repeatedly. Is there a way to make the bracket highlight persistent? ...

JavaScript error in Safari, only sometimes...

I have a webpage that is using jQuery to hide divs on the page load and show them later based on user interactions. In my $(document).ready() I execute a bunch of code to hide these divs and to bind a function to the click() handler from jQuery for the regions that trigger showing these divs. It also grabs some values out of the HTML t...

XML to JavaScript hashes/arrays on the client

Any client js libraries for turning XML into a JavaScript object? I'm specifically working with RSS and ATOM XML. I don't want to go from XML to JSON then eval(). I'd like to go from XML directly to JavaScript hashes/arrays. ...

What URL is the XtraUpload script posting to?

I am using the XtraUpload script from http://xtrafile.com. Their forum support is very poor, and I need to write a PHP function to post to remotely post to my XtraUpload website at http://uber-upload.com. So, I ask, ok, I beg for help. Can someone please tell me what the post URL is, and what variables are being sent (i need exact nam...

How can code in a JavaScript file get the file's URL?

I need to dynamically load a CSS stylesheet into a page that's on a different domain. How can I get the complete URL of the JS file to use in the href attribute of the stylesheet? For instance, here is the structure: http://bla.com/js/script.js http://bla.com/css/style.css I want to dynamically load the stylesheet into a page http:...

JQuery replacing image problem

Hi, I want to extend some JQuery code to replace an image once I click on it. I have this: var minimiseContent = function(e) { var targetContent = $('div.itemContent', this.parentNode.parentNode); if (targetContent.css('display') == 'none') { targetContent.slideDown(300); var minIcon = $('minimise', this.parentN...

Is there anything in the works with html5/javascript to prevent opening the same web-app in more than one browser instance?

Okay so it's sorta pointless considering that even if there was support for this you could still open more than one instance if you have more than one browser installed, but I was wondering anyway. ...

Prevent hyperlinks from being entered into a html form: client-side or server-side validation?

I'm still debating whether I want to do this or not but what I'm considering is preventing users from entering hyperlinks into a HTML form in my app. This is to avoid spammy links from showing up for other uses of the app since the app is based on user generated content. This is a Rails app, so I could do some backend validations on the...

Javascript error in IE8: Not implemented

This one really puzzles me, as the code looks completely harmless. IE8 halts script execution with a message: Not implemented. map.js line:66 char:5 Here is a snip from the code: 63 if(data.map[x] !== undefined && data.map[x][y] !== undefined) { 64 65 left = (x - data.dim.x_min)*32 + 30; 66 top = (data.dim.y_max - y)*32 + 3...

Detect bowser proxy setting enabled or not using Javascript

We have a coupon download functionality in our website. Users should download a plugin which allows them to then download the actual coupon. Plugin download is not working in IE6 with proxy settings. It is working in all other browsers even with proxy setting. Now, my client want to display some message to the user if the user is usin...

How do you clear an HTML form on page reload but not when the user navigates BACK to the page?

I am using the trick where you store some data in a hidden form in order to be able to be able to persist it so that when the user navigates away from the page and then uses the BACK button to come back I can restore the data to the page without hitting the server again... However, this trick means that the same thing happens when the ...

How to replace multiple strings with replace() in Javascript

Hey Guys, I'm guessing this is a simple problem, but I'm just learning... I have this: var location = (jQuery.url.attr("host"))+(jQuery.url.attr("path")); locationClean = location.replace('/',' '); locationArray = locationClean.split(" "); console.log(location); console.log(locationClean); console.log(locationArray); And here is w...