javascript

Simple Javascript encrypt, PHP decrypt with shared secret key

This is not about security. It is also not to make it hard to break. I'm looking for a simple algorithm to change a string (a url) in a way it does not resemble the original. The encryption will be done with javascript. Then I want to feed the encrypted string to a PHP function to change it back to the original. Both ends could share a s...

uibinder element get with jquery selector fail on chrome/safari

i have uibinder html element like below <g:HTMLPanel> <div class='thumbnailWrapper'> <ul> <li> <a href='#'><img src='41546-140.jpg' /></a> <div class='caption'> <p class='captionInside'>testing javascript</p> </div> </li> <div class='clear'>...

how to remove double white space using regexp (javascript)

how to remove double white space using regexp (javascript) ? var text = "My name is Anas Fares"; result var result = "My name is Anas Fares"; Maybe it needs regexp :) How can i learn regexp because it is very hard. Are there any simple book ? ...

Detecting IE8 reliably using javascript

I have written a web app that requires IE version 8 (or higher presumably). If I run IE8 on a clean windows install on a VM it reports 'MSIE 8.0' as a user agent when queried with navigator.userAgent in javascript. But on a colleagues windows 7 machine his IE reports version 8 in the Help|About window, but the user agent string is 'MSIE ...

Google maps, highlighting a div when corresponding pin is hovered

First let me start by saying i'm using a modified version of http://econym.org.uk/gmap/example_hoverchange75.htm With that said, the hovering of items in the sidebar highlighting pins works fine, however I need it to do the reverse also. I've tried adding different variants of document.getElementById("item"+i).style.background ="#F00"...

How to develop a real-time event analytics solution?

Hello all. I need to develop an in-house real-time event analytics solution for our web application (e.g: mixpanel, chartbeat, kissmetrics like tool). We mainly use ruby on rails, Redis, MySql and JavaScript. The analytics solution must have an API and must be real-time. I've never done any API nor worked with real-time data. What te...

How to delete a file using Windows Sidebar Gadget API?

I know that Windows Sidebar Gadget API provides functionality beyond normal Javascript capabilities. Does it manipulate files? How? I didn't find how to do it in the API Reference ...

update JS Var on chaging of a php var

Hi all, I got this prob. In a web page I have a DIV that display a counter ( a PHP variable, $count). I have also a JS function that change the INNERHTML property of the DIV. I'm not able to change the js var on the changing of the PHP one. HTML <DIV id="counter">0</DIV> PHP while (----) { do_something; $count++; } JS functi...

Navigation bar sticks on mouseout only in firefox..

Any help and/or direction is greatly appreciated. I have a dropdown nav bar that dynamically updates to load subpages using CSS and jscript. There's a Flash movie that the drop down menu will overlap on mouseover. Maybe this is causing a conflict with the mouseout function. However it works fine in IE this is only happening in Firefox....

Making this JavaScript function simpler with jQuery?

I have this, text, that when you click on it, you can edit it and when you click somewhere else it will store it to the database(by sending ajax call), and your edited new text will show. Here is it: http://jsbin.com/ewihu3 Try clicking at the text, and you will see it become a field and so. Here's my current code: http://jsbin.com/ew...

Javascript - how to give variables in a loop names like var_1, var_2 etc

Hello I am playing around with the Google Maps API V3. I want to create a series of markers on a map. I followed a tutorial and got: Now this code adds one marker - the first one. I am completely new to Javascript but from my PHP knowledge, I am thinking that the reason this is not working is because all of the markers are being sto...

Javascript generate color

Possible Duplicate: Generate lighter/darker color in css using javascript Hi all. I want to create a function in javascript that get as a parameter a color in hex format for example: #ff0000 . And generate 10 (N) thin colors , or 10 color darker then the color that we given. Please help me ...

Escaping single-quotes javascript

I think the below problem is something to do with escaping strings, but i'm hoping someone will confirm that. i need to append event.id to the submit value like so: /Events/Edit/ + event.id. There is definitely content in the event.id property as it displays correctly the second time i use it. $('.ui-dialog div.ui-dialog-buttonpane')...

Handling boolean values

Hi Everyone, Setting default values is one of my favourite things to do when creating JavaScript applications. While working, i came across a bug that could have easily escaped me. This is how the object is used. var obj = new App({ imgs: []; preload: false }); This is how the object is defined. ...

How to replace all html tags from <anything> to \n<anything>\n [using regexp (JavaScript)]

How to replace all HTML tags from <anything> to \n<anything> and </anything> to <anything>\n var text = "<anything>welcome</anything><anything>Hello</anything>"; result var text = "\n<anything>welcome</anything>\n\n<anything>Hello</anything>\n"; This code will help you (match all tags) </?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]...

Javascript issue causing IE to fail

I am getting this error Invalid character line 6254 character 9 the code there is return eval("(" + string + ")") I did a console.log(string) here is the json result Every other browser it loads fine, just nothing any version of IE ...

Can't get jQuery's .replaceWith() to work?

Hi. Basically I am trying to have jQuery replace the button with the form and status div once clicked. I am new to jQuery and hardly an advanced programmer so I am sure the solution will be relatively simple. On the other hand I am at my wits end with this issue and any help would be greatly appreciated. Thank you. EDIT: Solution fou...

Developing Windows apps with JavaScript.

I'm currently in the need of developing a Windows application. I want to keep things simple (in the spirit of uTorrent) and I would like the result program to be a single .exe file containing all that it needs. The program is simple. It just needs some UI. It needs to run for a long period of time (lay there as a tray icon). It needs to...

jQuery: onclick, edit field and show+save into an variable

Right now I have this in Javascript without jQuery: Here is it: http://jsbin.com/ewihu3 It's working just fine, but I wish to use jQuery for making the code simpler and shorter. I want exactly same things to do as on the example above, that when you click on the text, it should turn into an input field. And on blur it should display w...

How do I set a value in CKEditor with Javascript?

document.[form name].[textarea name].value=data; does not work $('#textareaID').val(data); does not work. These work without the editor applied. How can I set the value of the editor using javascript? ...