javascript

Frontend Session Counter : How long customer stayed on my website ?

Hello, I want to show my customer - For how long they are available on my site. I need live session counter on front end until they leave my site. This can be done by tracking customers IP address, But Newbie in Javascripts. Your help will be appriciated. Thanx ...

How to call https request in javascript?

i am doing phone-gap app, i want to access web service from server,in javascript get,post or ajax methods working fine for http url request but it cant work for https url request ,please help me,how to called SOAP or secure web service to parse JSON in phonegap through javascript ...

Ajax, not sending querystring data

var http = false; // Creates xmlhttp object if (navigator.appName == "Microsoft Internet Explorer") { http = new ActiveXObject("Microsoft.XMLHTTP"); } else { http = new XMLHttpRequest(); } http.onreadystatechange = function() { if (http.readyState == 4) { alert(http.responseTex...

jQuery / Javascript if statement speed

Given: var isIE = $.browser.msie && !$.support.opacity, isIE6 = isIE && $.browser.version < 7; Which would be faster: if(isIE6){ doSomething(); } else { doSomethingElse(); } OR if(!isIE6){ doSomethingElse(); } else { doSomething(); } Are they exactly the same in terms of speed? ...

resetting timer on setInterval without clearInterval

I have a simple slideshow which automatticlly changes the image using setInterval every 5 seconds. The user can also move from one image to another using previous and next links. If the user clicks the prev/next links the timer isn't interupted, so for example, if the timer is on 3 seconds when the user clicks the link the next image i...

color codes in textarea using jquery

Hello, Is it possible to color the user entering code (inside a textarea) using jquery. Specific texts like <h1>, <b> etc should be colored or highlighted. this helps to distinguish the opening closing tags. Please help ...

calling a method from an event handler

I have this code i am working on but every time i call init method I keep getting an error this.addElement is not a function is it because i can't call methods from event handlers ? function editor () { this.init = function () { $("#area").bind('click' , this.click_event ); } this.addElement = function () ...

Read an mp3's metadata

Is there a way to read an mp3's metadata using javascript for playing with the element? ...

How can I get jquery .val() AFTER keypress event?

I got: $(someTextInputField).keypress(function() { alert($(this).val()); }); Now the alert always returns the value BEFORE the keypress (e.g. the field is empty, I type 'a' and the alert gives me ''. Then I type 'b' and the alert gives me 'a'...). But I want the value AFTER the keypress - how can I do that? Background: I'd like to ...

Running javascript in AJAX loaded DIV

I have page loading, via AJAX a PHP page into a div. In turn, this loaded page has it's own javascript and AJAX loaded div. Reason is to allow user to select data > alter data within loaded data. I'm trying to do this without the help of JSON or such to communicate between JS and PHP. I'm guessing the parent calling page has already l...

jQuery UI Draggable 'stop' event called too many times?

I have a feeling I'm either misunderstanding the 'stop' event or not doing it right, but it seems to be called several times while the element is bound to is being dragged. makeAllDragable = function () { $(".test-table").draggable({ start: function (event, ui) { $(this).click(); }, stop: function (event, ui) { foo(...

How to use JQuery Validate to create a popup with all form error when the submit button is clicked?

I am using the JQuery Validation plugin for client side form validation. In addition to the colorful styling on invalid form fields, my client requires that a popup message be shown. I only want to show this message when the submit button is click because it would drive the user crazy otherwise. I tried the following code, but errorLi...

Solution to grab text from page and display it elsewhere?

I am trying to find a solution how to grab a text from one part of the page to be displayed on a different part of the same page (not stored). To explain this easier. I have this: <div id="test"> hello world </div> I want to grab the text "hello world" and display it somewhere else on the website as well. Im thinking that there migh...

How can I call a method on a custom object created in JavaScript using C#?

I have a WebBrowser control. I have added some JavaScript into the head tag and I can see it is working as expected by adding an alert. Inside of this js I am creating a function and adding some members to it's prototype like so: function test() { } test.prototype.run = function() { alert('success!') } function createTest() { ...

Can I define which characters are allowed to 'break' a word?

Hey guys, I'm showing up veeeery long URLs in my Safari extension. Obviously, they can't fit on a single line. Currently, word breaking rules make it so most URLs are on two lines: the first one is rather short and ends with the ? symbol, and the other is ridiculously long and contains all the rest of the GET parameters. I'd like to ma...

PHP & JavaScript source code formatters (prettifiers) - NATIVE only apps!

Hi, I know at least two PHP source prettifiers and one for JavaScript, but all of them are written in those languages - PHP prettifiers in PHP, JavaScript in JS ;] Now what I'm looking for is a prettifier for those languages which is a native application - can be C/C++ or Pascal, so that I can run it from commandline. Possibly open so...

cannot print popup displaying pdf file

I have a php file with the following code: <?php ?> <form action="" id="f1" name="f1"> <input type="button" name="preview" value="Open PDF" onclick="showPDF()" /> </form> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <script type="text/javascript"> function showPDF(){ var newwin=window.open("pdf.pdf...

how to call javascript function in main document from within iframe (ckeditor plugin)

I've built a simple CKeditor 3 plugin with one button that should just call a JS-function when somebody clicks it. The plugin (code when somebody clicks) looks like this and is working: var openAssetsBrowser = { exec:function(editor){ openAssetsBrowser(); } }; I always get the error "openAssetsBrowser is not a functio...

Find the contents of a directory

Is it possible to get the contents of a directory with javascript? ...

value of textbox has changed or not

how to find whether a value of textbox has changed or not using javascript(even if we copy something and paste it using right click and paste) ...