javascript

jQuery select not working in IE7

Hi there, I have a jQuery select which works in most browsers axcept IE. The code is as follows; <script type="text/javascript"> function parseCatSelect() { $('#d_cat select:empty').parent().html('<p><span class="placeholder">No categories available</span></p>'); $('#d_cat select').attr('name', '...

How to report progress of a JavaScript function?

I have a JavaScript function which is quite long and performs a number of tasks, I would like to report progress to the user by updating the contents of a SPAN element with a message as I go. I tried adding document.getElementById('spnProgress').innerText = ... statements throughout the function code. However, whilst the function is ex...

How to get the file name for <input type="file" in jsp

I want to read the file path from html input type="file" (the entry selected in the file dialog by the user) <script> function OpenFileDialog(form) { var a = document.getElementById("inputfile").click(); SampleForm.filePath.value = //set the path here document.SampleForm.submit(); } </script> ...

Are Cross Domain Flash Local Shared Objects (LSO aka Flash Cookie) possible

Hi, I found several solutions for creating Flash LSOs from JavaScript (for example: http://www.nuff-respec.com/technology/cross-browser-cookies-with-flash ) If Page (www.hostA.com/index.html) and the .swf file are from the same site, everything works fine. No I'm trying to load the page form www.hostA.com/index.html, which includes www....

Close event in Safari iphone ?

Hello, Is there a way to know that the user is closing the navigator, and/or the tab in Safari for iPhone, so that I can save data to localStorage, or do I need to do it for every input ? ...

Getting Unknown Runtime Error When Using innerHTML for setting html form text field value.

Hi, I am getting Unknown Runtime Error When Using innerHTML for setting html form text field value in Line2 //Line1 var topicName = msgXML.getElementsByTagName("tname")[0].childNodes[0].nodeValue; //Line2 document.editDataForm.editTopic.innerHTML = topicName ...

JQuery: Read each line of an element

Hello, Suppose I have this html markup: <div id="wrapper"> <pre class="highlight"> $(function(){ // hide all links except for the first $('ul.child:not(:first)').hide(); $("a.slide:first").css("background-color","#FF9900"); $('ul.parent a.slide').click(function(){ $('ul.parent a.slide').css("background-col...

random quote generator with php, ajax and mysql

i've tried using this code and this to make a random quote generator, but it doesn't display anything. my questions are: what is wrong with my code? in the above tut, the quote is generated on a button click, i'd like a random quote to be displayed every 30 mins automatically. how do i do this? //////////////////////// quote.html: ...

iPad Web App: Detect Virtual Keyboard Using JavaScript in Safari?

I'm writing a web app for the iPad (not a regular App Store app - it's written using HTML, CSS and JavaScript). Since the keyboard fills up a huge part of the screen, it would make sense to change the app's layout to fit the remaining space when the keyboard is shown. However, I have found no way to detect when or whether the keyboard is...

holding scroll position of a div tag as page refreshes

I have a div tag and I want to hold the scroll position even if the page is refreshed.How do i implement in JavaScript. Any help would be appreciated. Need just In IE. Thanks ...

Problem with jquery ajax form on Codeigniter

Everytime I test the email is send correctly. (I have tested in PC: IE6, IE7, IE8, Safari, Firefox, Chrome. MAC: Safari, Firefox, Chrome.) The _POST done in jquery (javascript). Then when I turn off javascript in my browser nothing happens, because nothing is _POSTed. Nome: Jon Doe Empresa: Star Cargo: Developer Email: [email protected]...

JavaScript: count minimal length of characters in text, ignoring special codes inside

I want to ignore counting the length of characters in the text if there are special codes inside in textarea. I mean not to count the special codes characters in the text. I use special codes to define inputing smileys in the text. I want to count only the length of the text ignoring special code. Here is my approximate code I tried to ...

How to escape regular expression in javascript ?

My codes is like pattern = 'arrayname[1]'; // fetch from dom, make literal here just for example reg = new RegExp(RegExp.quote(pattern), 'g'); mystring.replace(reg, 'arrayname[2]'); But it just cannot get running with error message says: "RegExp.quote is not a function", am i missing something simple? ...

this fadeIn / fadeOut jQuery code crashes my browsers- Why ?

I created this code for a conference website that I had been tasked to do. It is a simple fade in and out loop using window.setInterval. I've tested it on firefox, safari and google Chrome. The first 2 just stop responding after awhile, while google chrome gives me a note saying that the script uses too much memory. Which part of my scr...

How can I create an automatically generated alteranate table row color ?

Good day, I've been trying to make this CSS code work: table.mytable { margin: 0; padding: 0; border: 0; font-size: 0.8em; border-collapse: collapse; } table.mytable td, table.mytable th { width: auto; padding: 2px 4px; vertical-align: top; } table.mytable th { color: #fff; background:url(images...

how to use window.onload?

I'm refactoring a website using MVC. What was a set of huge pages with javascript, php, html etc etc is becoming a series of controllers and views. I'm trying to do it in a modular way so views are split in 'modules' that I can reuse in other pages when needed eg. "view/searchform displays only one div with the searchform "view/display_...

How to interpolate hue values in HSV colour space?

Hi, I'm trying to interpolate between two colours in HSV colour space to produce a smooth colour gradient. I'm using a linear interpolation, eg: h = (1 - p) * h1 + p * h2 s = (1 - p) * s1 + p * s2 v = (1 - p) * v1 + p * v2 (where p is the percentage, and h1, h2, s1, s2, v1, v2 are the hue, saturation and value components of the two ...

Slideshow with javascript without absolute positioning

I need something like this http://jonraasch.com/blog/a-simple-jquery-slideshow but w/o the absolute positioning. Is it possible? If not, how do I deal with the absolute positioning - if I make it centered for one screen res, it won't be for another. Any tips? ...

Google Maps: How does Trulia create their custom InfoWIndows?

I really like how Trulia.com has created their custom Google Map InfoWindows. What I like in particular about Trulia's implementation of the InfoWindow is: Extends beyond the map border: Google Maps InfoWindows are contained within the map border whereas Trulia's seems to be able to float on-top of the map Always displays InfoWindow n...

Youtube player JavaScript API, player position problem

Hi, I am using Youtube's JavaScript API to embed Youtube player into my site. The problem is that it appears on the top of all elements. I have read couple previous answers about setting "wmode" to "transparent" or "opaque", but it doesn't seem to work or it's either me doing something wrong, anyways here is my code: var params = { all...