insert an element at a certain time of the day
what is the best way to do something , like inserting an element at a certain time of the day ? should I use setTimeout() os is there a better way to do it ? ...
what is the best way to do something , like inserting an element at a certain time of the day ? should I use setTimeout() os is there a better way to do it ? ...
I am developing a website that relies on pulling the geolocation data of a mobile user. I am doing it the typical way via: function initialize() { if(window.google && google.gears) { var geo = google.gears.factory.create('beta.geolocation'); geo.getCurrentPosition(useLocation, errorOnLocate); } else if(navigator...
Hi, I'm not too good at JS, but have survived thus far. I'm creating a sort-of complex JS object and wanting to sort it. The object's structure looks like this: cart.attributes = [ { Attribute, Value } ... ]; I'm creating a unique attribute that tells me 3 things separated arbitrarily by a colon: (Product ID):(Product...
I am building a web application that will let users follow discussion threads, in Q&A format. To that end, when displaying questions, I have a "Follow" button next to each question. I want users to be able to follow these threads without reloading the page, thus using AJAX. So, I want the AJAX call to: 1) Submit a form updating the d...
It's pretty common knowledge that JQuery is in both the Microsoft and Google CDN, but there are more and more I'm hearing about such as Yahoo YAPI and others. I'm a new web developer and am interested in hearing about what libraries are widely used, located on a CDN, and worth learning about. What libraries would you recommend? ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Form</title> <script type="text/javascript"> function isValidUsername() { var user_name = document.getElementById("user_name"); var pattern =/^[A-Za...
Say I have an array-ish container of decimal numbers. I want the sum. In Python I would do this: x = [1.2, 3.4, 5.6] sum(x) Is there a similarly concise way to do this in JavaScript? ...
I need to figure out the best way to determine if someone is the actual owner of a website. I don't just mean the domain although in a lot of cases that might be the case. My first inclination was to have them put a special comment in their HTML that my program can scrape. e.g.: <!-- @webcode:1234 --> One possible problem with that...
I need to move some content from head tag into body tag. Can anyone can me some advice please? ...
Hey all how do you use the z axis when drawing and moving a model? I have the following: canvas = (function () { canvas = { canvas: $("canvas"), models: [{ start: [10, 10, 10], end: [1, 10, 10], color: "silver", }, { start: [30, 30, 30], end...
Hi! I'm asking for some orientation and recommendations for developing something similar like the yahoo movies page: http://movies.yahoo.com/ I don't know how the thing at the top with the arrows and different title of movies is called but I've seen it several times.(the one that has 4 options:expendables, yogi bear, etc) I want to add ...
Hello all, What is the best way to simulate a user entering text in a text input box in JS and/or jQuery? I dont want to actually put text in the input box, I just want to trigger all the event handlers that would normally get triggered by a user typing info into a input box. This means focus, keydown, keypress, keyup, and blur. I thin...
Hi, So I'm trying to have a background image disappear and then have some text appear in the div with a link. I've gotten the image to disappear on mouseover but I can't get the text to display. Here is what I've got so far. I'm kinda new to this stuff. /* I'm have the image removed with the first line, then setting the link as h...
I am new to Rails. In my web application, the user can type the contents of a file in a textarea or a content Editable iFrame and when he saves the file, the contents should be written to the file with the file extension specified by the user. How can I do so?? ...
I am looking for a datagrid which can show hierarchical information. I don't need it to be ajax driven ... can simply even be from static data embedded in HTML. ...
I am using cakephp I have 2 links: <a href="#" tabindex="1" onclick="base_load_demo1('http://www.boxyourtvtrial.com/widget/beer/main/');" >beer</a> <a href="#" tabindex="2" onclick="base_load_demo('http://www.boxyourtvtrial.com/widget/cocktail/main/');">cocktail</a> With the following JavaScript: var Url1 = "http://www.boxyo...
I want to center this material horizontally: <a href='/big.jpg' class = 'cloud-zoom' id='zoom1' rel=""> <img src="/small.jpg" alt='' title="Optional title display" /> </a> ...
<!DOCTYPE HTML PUBLIC "-//WC3/DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <body> <label>A label <input type="button" value="First" onClick="alert('First');" /> <input type="button" value="Second" onClick="alert('Second');" /> </label> </body> </html> Tried this code in Firefox 3.6.8. When I...
Is there a way in javascript to obtain the names of all fonts (or font-families) that the browser can show? (I want to give the user a dropdown with a list of all available fonts, and allow the user to choose a font.) I'd prefer not to have to hardcode this list ahead of time or send it down from the server. (Intuitively, it seems like...
Thanks, resolved one issue, this is the next. As a novice at this, I am still getting an error and the simple application is not working. I get INVALID_STATE_ERR: DOM Exception 11 when I execute the req.open("Get",url,true); command in the javascript in located in the following index.html file. The simple appl is not working. I get this...