javascript

Browser Side Photo Editing Library

Hi! Currently I'm searching for a free solution to simple edit some photos at the users browser. Resizing and Cropping would be mandatory. I'm not searching for an online service (for example SUMO or PIXLR which are great), because I want to include the software into a WYSIWYG Editor. JavaScript would be really nice, but it would have ...

JavaScript check of a form, not waiting for AJAX response

this is a part of the check in my form function check(theform) { var re = /^\w[0-9A-Za-z]{5,19}$/; if (!re.test(theform.username.value)) { alert("not valid username"); theform.username.focus(); return false; } $.ajax({ type: "POST", url: "username.asp", data: "username="+theform.username.value, success: fun...

How to scroll the horizontal scrollbar in an iFrame from the parent frame?

Is there any cross browser way to scroll the horizontal scroll bar of an IFrame with super wide content with Javascript inside the parent frame. Also I need it to be attached to the mouse wheel event. Answer (please look at Marcel Korpel documentation bellow for details) var myIframe = document.getElementById("iframeWithWideContent")...

remove/restore elements, maintaining their events and element's children

I came to a situation where I need to edit the following in a way that, on some event (lets assume the 'click' event in this case) I need to remove (or unwrap?) the .container and the .header and have the .itemlist still visible/available on the page. And then, I need to restore .container and .header back again on some other event, whil...

Accessing Excel formulas from clipboard in HTML / JavaScript

E.g. I got a cell with the formula LEN(A3). Pasting it to an HTML text area or an text editor will just paste the value. Is there a way to access the formula in a cell from the clipboard instead of the actual value? ...

Javascript: How many times a character occurs in a string

Hi all Is there a simple way to chack how many times a character appears in a String? Thanks in Advance Ruth ...

javascript validation on tiny mce text editor

Hai I want to validate (empty check) a tiny mce text editor using JavaScript. Does any one know this? I have used the normal empty check function. But it's not working. Does any one help me? also I want to know how validate empty check in FCk editor. ...

How to implement a book preview (2 page spread) without using Flash?

I'm looking into a solution for work, where you have a two page spread of the book to preview. Either side of this, you can hover in the corner to create a pseudo-flip and then click the mouse button to actually turn the page. I know there is many Flash solutions out there, but in this case we cannot use it... So we are looking for a pos...

Help to implement if-statement with array values

Hi all. I have a following source code php+js: http://pastebin.org/277948 I want to rewrite it using pure JS, but can’t imagine the way. Any advices are appreciated. ...

Getting mouse position in major internet browswers with javascript

I read this article regarding creating popup notes with javascript and css The problem is that this one works only in IE since window.event is undefined in Firefox. // assigns X,Y mouse coordinates to note element note.style.left=event.clientX; note.style.top=event.clientY; So could you point me a fully working example? Or at least, ...

Allowing just Numeric Text on Input Text field

There are many solutions suggested on Stack Overflow but i have not found yet, one that fully satisfy my requirements. I was using Jquery Numeric plugin but i found that is not working (does not allow pasting) on FireFox 3.6 on Osx. I'm searching a Jquery plugin or Javascript snippet that allow just Numeric Text on a Input Text field...

javascript html object model and template engine

I am looking for javascript library which can do something like var items = [1,2]; var html = div( ul({id:"some-id", class:"some-class"})(items.each(function(item){ return li(item); }) ); html == "<div><ul id='some-id' class='some-class'><li >1</li><li>2</li></ul></div>" ...

What does this script do? Is it malicious?

This script was added to a defaced web page of a client web site running PHP. I have no clue what this script can do, and do not know whether this is really malicious. Can someone advise. Please find code below.... var GU = ''; var h; var X = new String(); var mP = ""; H = function () { var F = ["hu"]; function L(Lc, O, d) { ...

How to handle events from button's from browser

hey there, i want to implement a little feautre with jquery, where i want to catch the event that occures when the user clicks on the "Back" button of his browser, to get to the last page. but how? didn't find any working solutions :-( ...

window.open open the page in a new tab instead of in popup window

i'm trying to open popup window this this jscript: window.open(myUrl, ""); for some users the page appears in a new tab, but I want it in a popup window. maybe someone know any reason for it? ...

How to detect ctrl+v ,Ctrl+c using Javascript?

How to detect ctrl+v ,Ctrl+c using Javascript? i need to restrict pasting in my textareas,end user should not copy and paste the content, user should only type text in text area. how to achive this. Thanks in advance. ...

What is the difference between C++, Java and JavaScript exception handling?

They are very different kind of languages and the way they handle exceptions might be rather different.. How is exception handling implemented and what are the implementation difference within these languages? I am asking this question also because I noticed that C++ exception handling seems to be very slow compared to the JavaScript ve...

What is the difference between JSON and Object Literal Notation?

Hi, Can someone tell me what is the main difference between a Javascript object defined by using "Object Literal Notation" and JSON object? According to a Javascript book it says this is an object defined by using Object Notation: var newObject = { prop1 : true, showMessage : function (msg) {alert(msg)} }; Why it is not a JS...

Redirect parent window from iFrame

I have an asp.net page inside an iFrame. I want to redirect the parent page (that sits outside the iFrame) when an asp.net button on the asp.net page in the iFrame is clicked. The asp.net button will need to do some processing before re-directing, so I guess I need to call javascript from the asp.net ...

Populate text box with JavaScript on PageLoad

I have a text box called txtName on my form. In my page I know I need to place the code in my HEAD tag like so...... <script type='text/javascript' language="javascript"> document.FormName.txtName.value = "Robert"; </script> But I cant seem to set a value to my textbox txtName with the above code...... ...