javascript

How to get image path for <img src="?"> tag from XML file

I'd like to use an xml file <pics> <pic no="1">c:\pic1.jpg</pic> <pic no="2">c:\pic2.jpg</pic> <pic no="3">c:\pic3.jpg</pic> <pic no="4">c:\pic4.jpg</pic> <pic no="5">c:\pic5.jpg</pic> .... </pics> in an html table: <table cellspacing="2" cellpadding="2" border="0"> <tr> <td><img src="" width="150" height=...

cakePHP or PHP with Plupload

I upload file = Plupload . I checked varibles $_FILES, $_POST, $this->data , all is empty and !isset please help me function mod_uploadImg($id = null){ if (!$id){ return false; } if (!empty($_POST)){ CakeLog::write('activity', 'file exist'); } if (isset($_FILES['file'...

Does it make sense to use Web Workers for a game?

Hi, I am working on a game that has AI logic, movement, etc and drawing. Does it make sense to calculate moving and AI logic using Web Workers? But how do I do that -- because the workers need to know so much about the main thread like the positions of certain objects for collisions, amount of bullets, etc. It feels like impossible beca...

good example of OO JS?

Hi, Can anyone point me in the right direction of some real world object-orientated javascript? I'm learning OO for javascript from a few books but all the examples given in these books boil down to the dog object inheriting from the animal prototype or similar. I really want to see something a bit more substantial. I've looked at jQu...

Need Help with a new project

Hello, I am starting my first software engineering job in a week and wanted to sharpen my skills up. I'm looking for someone to suggest a good week long, web application project that can help me sharpen up my C#, Javascipt, and JQuery. Thanks! Brandon Edit: As noted below this is a pretty broad question. Let me give a little more...

Problem with concat string in jquery animate

count = 0; total = 2; jQuery("#slide").everyTime(5000,function(i){ if(count == total-1) { count = 0; jQuery(this).stop().animate({backgroundPosition: "0px 0"}, {duration:1000}); } else{ jQuery(this).stop().animate({backgroundPosition: "-"+950*count+"px 0"}, {duration:1000}); count++; } }); ...

Embed raw data in HTML to parse in jQuery

I've been living in the desktop world for most of my career, so forgive me for asking such a basic question, but I'm not quite sure where to start looking. I want to return some raw data along with my HTML, and parse and display the data using jQuery as soon as the HTML is ready. I know roughly what my js code should look like, but I'm ...

Seeking Calendar on JS or JQuery

Hello! Does anyone know similar calendar as in the picture below (see url), just do it on Java Script or JQuery? Must need the opportunity to choose by the hour and day. Thank you! link text ...

Is there a function similar to setTimeout() (JavaScript) for PHP?

The question sort of says it all - is there a function which does the same as the JavaScript function setTimeout() for PHP? I've searched php.net, and I can't seem to find any... ...

Embedding Javascript Within an Image File

I've noticed a new trend in distributing potentially unsafe code where people will post an image to a server with a watermark suggesting that they change the filename to have a .HTA file extension. I realized that .HTA was an HTML Application file, which are implicitly trusted by Microsoft's logic and can contain code to do just about a...

String operations in Vista/W7 gadget's javascript

I experimenting with writing Vista/W7 gadgets. In my experiment I want to write the modification date of certain files on the system. Problem is that if I want use string manipulation functions the gadget just stops writing its output. Part of the gadget's code looks like this: function format_lmd(lmd) { // Parse something like...

Using JSONP when returning XML

I asked an earlier question which was definitely helpful and let me know about JSONP. However, I see that I have to specify JSONP as the datatype. Now, as far as I know, that is the return type of the data coming back, which would be XML. Can XML be returned using JSONP or am I limited to it coming back as JSONP format? Thanks! ...

loop through some urls using XMLHttpRequest's open() function

i am making a XMLHttpRequest open() call from a for loop.the loop iterates through set of links.I want to wait till the readyState becomes 4(the response comes) before going in to the next iteration.How can i do this?please help ...

How to do this without eval()

for (var i in variables) { eval('var ' + i + ' = variables[i]'); } Basically, I want to transfer variables properties to local variables. Is there an alternative to using eval() Or which of these is better: 1. var _ = variables; for (var i = 0; i < 100000; i++) { _.test1(); _.test2(); _.test3(); } 2. with (variab...

How to prevent Jqtouch autoscrolling to div with current class?

I'm using Jqtouch to design a iphone app. As I'm using a standard header/toolbar at the top, I want to simply have it fixed there without moving. I found out how to do this by creating a div with class toolbar and setting CSS display to block and min-height to 0px with important. However, when it starts up and every time I change pages...

Print in separate page javascript?

I am currently using php and getting complete user details and displays it into a html table. The problem that I have is when I print 3 tables each of them are printed on each page perfectly. But when I try to print over 3 tables, each table moves upwards and the tables are printed partially on each page (1 ½ user details in each page). ...

Create a large bit field?

I want to create a large bit field in JavaScript that will effectively represent a multi-dimensional array of markers (uses indexing to jump to various dimensions in the physical "1D" structure). Rather than a bunch of numbers, I'm considering how I might use a string as bits, so I can allocate a string of the appropriate length first. ...

Why are functions in JavaScript set to global variables instead of plain functions?

I am wondering if anyone knows why some people define global variables that are set to functions vs just defining a global function name. For example: var foo = function() { alert('hello!'); } instead of function foo() { alert('hello!'); } Wouldn't the second method be better since there is a chance something might overwrite the f...

Portlets: How to obtain portlet unique javascript-names

The JSP-Portlet taglib provides a unique namespace for each portlet instance, that can be used as a prefix to get portlet unique names. Is it possible to create such portlet unique names in external javascript-files? ...

Check message for "bad words" and "unseriousness" with php?

Possible Duplicate: How do you implement a good profanity filter? I have a classifieds website, and when displaying a classified, users have the option of mailing a message to the poster of the classified. I need to check this message against bad words and unseirousness before sending it. Firstly, how can I check some text a...