javascript

auto generating the doctor unit id using php, codeigniter!

Hi Guys, i'm developing a site using codeigniter, in my app i have this scenario each patient is assigned to a doctor unit and there are 6 doctor units operating in the hospital some times one or two doctor units may be not operating some doctor units are not operating is certain days, i.e one can operate on monday,wednesday and frida...

Getting content from a phpfile every X seconds with jquery?

Is this possible? I need to get some data from another phpfile and I want it to appear every X seconds without you having to refresh the page. ...

Making combos with keyboard and detecting the most precise

On the window I bind two keydown events. The condition for triggering a callback function is a certain sequence: Event #1: ["down", "right", "a"] Event #2: ["down", "right", "down", "right", "a"] How can I check if the user pressed the event 2 keys and then cancel the event 1? Here is the code, focus on the red div and press the keys...

Is there a free website to store code (php, javascript, css) online?

Hi guys, I am looking for website to store my code and then reused if may I need it. Would be great something like Delicious but for coding or something like Snippely. Thanks. ...

Appending objects to existing objects

Are there any existing methods to append an object to another object? I've had a quick stab at throwing this together but I'm not sure about a couple of things: Am I handling methods correctly? I added an exception for append but what about when other prototype functions exist? Should I just ignore functions in the new class? What sho...

JavaScript style and standard practice - "static" method definition of custom user function/object

Forgive my probably incorrect application of terminology in this question (btw, please correct me where wrong). Let's say we have a custom object we want to define. Some of the methods on this object make sense to be 'instance' specific. And we also have some methods that are really independent of the instance, sort of like a public s...

How do I set the z-index of a table row?

Maybe what I am trying to accomplish is not feasible but the general idea is that when a person clicks a table row, the page dims (like a modal) but leaves that row visible for editing. I tried setting the z-index of the table row itself but it did not work. It will work if I set the table rows position attribute to absolute but that s...

Adding delay to jquery event on mouseover

I am trying to add a simple delay to a mouseover event of a child and having difficulties. (Still learning!) This enables me to show the popup after a delay, but shows all of them simultaneously: onmouseover='setTimeout(function() { $(\".skinnyPopup\").show(); }, 600)' and this works to show only the popup I want with no delay: onmo...

What is this design pattern known as in JavaScript?

I was looking over the js source code for Scrabb.ly. I've noticed that they would do something like so for each of their distinct "classes": var Board = (function() { var self = {}; // settings for board self.options = { debug: true, addedPlayTiles: function() {}, clearedPlayTiles: function() {} }; // set to tru...

how to set action attribute of the html:form according to javascript conditions written below

function setReqcode(id,methodName){ if(document.getElementById('approve').value==id) { alert("inside approve"+methodName); action="ProcessPath.do?reqCode=approveVersion"; } if(document.getElementById('reject').value==id) { alert("inside reject"+methodName); action="ProcessPath.do?req...

JavaScript and CouchDB - How do I avoid cross-origin policy errors on GET/POST/PUT/DELETE requests

I am posting this question on Super User as well. In my opinion this question overlaps the two... I am creating a simple JavaScript wrapper for CouchDB's REST-ful interface, but I am stuck on same-origin policy issues. So far I've been developing my code to work locally - and only as a proof of concept - on Mozilla FireFox. My server i...

Update URL parameter with javascript, without ruining the history?

I'm looking for a way to update the url in the status bar.. I have a gallery, and when you click your way through the gallery I want the image ID to show up in the URL, so that the user can link directly to the image.. I've read about using hash and so. but as far as I've tried it, that "ruins" the history. If I click the back-button in...

How to get this ajax drop-down selector to work across all browsers?

I wrote this code that populates a <select> box with the results of an ajax call... (function() { var cache = {}; var queue = {}; $('select.country').live('change', function() { var $countrySel = $(this); var $provSel = $countrySel.closest('tr,.label-and-input').next().find('select.province'); var $p...

One thing I don't understand about unobtrusive javascript

I like the idea of separating functionality and this seems like the way of the future. But I'm used to integrating javascript inside loops in an embedded language like Rails ERB or PHP, where I can use the ID of a particular object as a reference in the javascript. Rails example: <% @comments.each do |comment| %> <div id="comment_<%...

why my code can't alert the map's zoom when zoom changed using MVCObject on google-maps v3 .

this is my code : <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> <script type="text/javascript"src="http://maps.google.com/maps/api/js?sensor=fal...

How to get the url for a ajax page?

I'm pretty new to ajax and I applied it succesfully to a Drupal site. But I was wondering, how do I get an URL to a page where part of the content is loaded through ajax. Is this even possible? The JSON object is retrieved on click, so how do I make it work when retrieving a certain URL? I realize this is a very broad questionany, any h...

future for web server side and client side languages

Possible Duplicate: Which is the future of web development: HTML5 or Silverlight(or other RIA framework)? What do you think about the distiction of server web language like php, ruby, python, ... and client side language(s) into web browser, like javascript? I mean, with the evolution of the web application I think that a lot ...

Javascript if statement refuse to load correctly from exterior script IE6 IE5.5

I see a very funny behaviour in my page when it comes to IE6 and IE5.5. I have a script (supersleight if you know about it) that puts PNG's back in business when dealing with IE6 and IE5.5. During execution of this, I want to change the background into using the Explorer alpha filter (if Javascript is turned on, use filter, otherwise sti...

Javascript to run after onLoad but before anything else to set defaults

Hey guys, So I have an .aspx page loading up and populating drop downs based on a lookup table in the database. What we want is for the user to be able to configure which of these values comes defaulted by specifying that value in a drop down somewhere else in the app. Now, it's easy to default the "first" value, or something like that...

window.open not working in IE

Apparently, this call to window.open is not valid under Internet Explorer. The Javascript code on my site is not running, I would assume it is due to that error. The line it tells me the error is on, is the call to window.open, apparently an argument is not valid there. $('.objeto').click( function() { var center ...