javascript

Structure of orders in restaurant

What would be the best way to structure orders for a restaurant (available languages are php and javascript)? Since there are multiple tables (the ones you keep things on...), I thought of using objects in javascript. But I am quite new to javascript and absolutely new to OOP, so I'm not sure whether this is the best solution, and whethe...

Can a JSON object returned by PHP contain a date object

Is there a way to create a JSON object in PHP that contains a javascript date object? Does json_encode automatically convert PHP's DateTime to Javascript's date? ...

Enabling transparency on a texture in O3D

I have a texture of a set of lungs and the heart that I am applying to a series of triangles. The texture is a .png file and has a transparent background but when I apply it in O3D it shows up with a white background. How would I get this to show up as transparent? ...

How do hosted services like UserVoice embed their content on other web sites?

Hi, How do hosted services like UserVoice embed their content on other web sites? I see that it is via including a JavaScript file from the service provider on your own page, however, what I'm interested in are the building blocks for creating a service like that. For example, do they use a library like jQuery, mooTools, or prototypej...

Obtaining the functionality of Flex Tile Container in HTML

The Flex tile containers will create and remove tiles as the data changes and seems good to use in areas where the content is dynamic. How to implement this functionality in HTML? I guess that we need to use some JS and/or CSS. Any inputs? ...

Simplemodal plugin facing a problem on IE8, with a textbox and a link on the main page

Hi I have the SimpleModal working very well on my site. But i'm facing a problem (only with IE8), i can't resolve. My simplemodal is showing over a banner (jquery powered) that simply do a slideshow. The diferrent image have some link on them. When my simplemodal is showing, it overlay the banner slideshow. This modal has some textbox...

Is there a better way to reference an outer scope to this in Javascript?

I've seen and written many javascript methods like this lately: var myObj = { dialogOptions: {...}, init: function() { var $this = this; var something = $("<div/>").load("...", null, function() { $(this).dialog($this.dialogOptions); }); } } Now, this works due to the nature of closures, but the named variable r...

jQuery plugin that deserializes XML?

Is there an XML deserializer for javascript? Preferably in the form of a jQuery plugin. ...

modeless window to behave like a modal window using javascript

Hi, I have a requirement to have some modal popups appear on a webpage. At first i implemented them as true modal windows, but then i found out that true modal windows cannot communicate with parent window in IE. Now i am trying to implement them as regular windows that always steal focus, which is sorta working. Here is the code tha...

Using JavaScript or jQuery to track views of an actual HTML element (vs. just page loads)

My current project requires (if possible) tracking actual views of a JavaScript widget, so that we can compare/control this data against the total number of pageviews reported by our Analytics software (Clicky and/or Google Analytics). Basically, we're selling this widget to a client and want to be able to provide solid metrics to demon...

Easier way to turn off paging

I want to taking paging off of my gridview. I am doing this in javascript by redirecting. I'll explain below. But i would rather take off paging and have just my Gridview reload in the update panel. How can that be done? Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Request.Params(...

Javascript to ActiveX variable type

ActiveX object method has this signature. long DirectIO(long Command, long* pData, BSTR* pString) Int32 DirectIO(Int32, Int32 ByRef, System.String ByRef) I'm attempting to call this method from javascript. I've tried many combinations but always get a "Type mismatch" error. ...

Javascript or jQuery: Download and redirect

Currently some guys programmed this in a HTML page: <script> location='http://example.com/downloadable.zip'; </script> They want to redirect the user to another page once the file has started downloading. I can only modify this page but not the destination page. What would be a good and clean javascript solution for making a user...

Force a download of a text file in IE7 using javascript

Saw a similar question at http://stackoverflow.com/questions/349067/download-a-file-using-javascript but this one is specific to IE and I'm using extjs and alfresco (opsoro). I can get a download prompt for text files fine in Opera, Chrome, and Firefox, but not IE. Below is a list of what I've tried so far, which all work on other br...

Where to perform argument validation in JavaScript?

Yeah, read properly. In the last time I saw different patterns of argument validation in JavaScript (functions) and wondered which of them would be best-practice. At first I'll show two example code snippets. The first shows an (in my words) "immediate" argument/condition validation and the second one a "delayed" validation. Each of them...

Jquery - Loading a page with .load and selector doesn't execute script?

I'm trying to load one page into another using the .load() method. This loaded page contains a script that I want to execute when it has finished loading. I've put together a barebones example to demonstrate: Index.html: <html> <head> <title>Jquery Test</title> <script type="text/javascript" src="script/jquery-1.3.2.min.js"></script>...

jQuery .live() "click" event being unbound when new matches are added to the DOM

Here's the problem I'm having. I have two jQuery .live() events, both for click events. These are initialized at the beginning of the page's load; they then wait until items matching the selector come along and are clicked on. Now, the problem with these is that when an item is added to the DOM that matches the selector, the live even...

IE runs slow while processing javascript compared to FF and Chrome

Hey everyone, I am trying to troubleshoot why IE is slow slow processing this javascript compared to Chrome and FF. In Chrome and FF there is no delay for any onclick events but in IE it pauses for like 5 seconds before doing anything. Here is the link to the code i am running. http://geekswithblogs.net/ptahiliani/archive/2009/08/13/h...

How to block form submission when the enter key or return key is pressed?

I have a form that I use JQuery, I don't think I need to put code in this post, the question is pretty basic. But I would like to block the form from submitting when people press the Enter Key or the Return Key. At the same time, I have textareas, where the user will need to be able to press the Enter / Return keys. ...

need to add .css to a class

I need to add some css to a class. This is what I have so far: $(document).ready(function() { $('.tech').css({ "border-bottom": "dotted 1px #0860a8", "text-decoration": "none" }); $('.tech').Tooltip(onMouseEnter) }); Its not working. What can I do to show up for all class="tech" ...