javascript

JQuery Slider for Mobile application

I would like to use the JQuery slider for my mobile application http://docs.jquery.com/UI/Slider However, using the Slider plugin, requires me to use the entire JQuery core (29kb) + Slider plugin (6kb). Typically, that's okay but for a mobile application - that's a lot of data. Question: Anyway I can use the JQuery Slider and elimina...

Autoplay for javascript moving boxes

Hi all, Please go to : http://gati.simptome-remedii.ro/ . As you can see there is a carousel effect in the header and it goes forward and backwards once you click on the arrows or press left/right key . I need it to autoplay so I need an autosliding effect. Time interval should be 5 seconds ( I guess I can set that up later ) . This ca...

Disabling the toolbar?

I would like to disable the toolbar via a link in my HTML. I've tried: <a href="window.open(URL, '', 'toolbar=no,menubar=no...')">Click</a> But it is not working. Could somebody provide some direction here? I would prefer to not use Javascript. ...

Google Maps: Geolocation assistance

For some reason, the following Google Maps v3 same does not geolocate my IP http://gmaps-samples-v3.googlecode.com/svn/trunk/commonloader/clientlocation.html But the following link that using Google Maps v3 + Google Gears can geolocate me: gmaps-samples-v3.googlecode.com/svn/trunk/geolocate/geolocate.html Question: Any ideas why ...

how to check "contains" using jquery

Hi, I tried of checking contains option using jquery for the birthday but its getting exception var _dob = "4/10"; // this line doesn't work var _adob = _dob.contains('/') ? _dob.Split('/') : _dob.Split('-'); $('#Month').val(_adob[0]); $('#Day').val(_adob[1]); but i can't able to split.. its resulting in error on getting _adob itsel...

getJSON not working. got tired of js problems.

function addSearchPattern(file, aStatus, aRule, aExpression, aCategory) { $.getJSON(file, { status: aStatus, rule: aRule, expression: aExpression, categoryID: aCategory }, function(data){ if(data.errors.length > 0) { var errorText = ''; $.each(data.errors, fu...

Quick javascript split question

Just a quick question regarding the split function How can I split my string at every 2nd space? myArray = 'This is a sample sentence that I am using' myArray = myString.split(" "); I would like to create a array like this This is a < 2 spaces sample sentence that < 2 spaces that I am < 2 spaces and if the last word is not a space...

AJAX + RAILS Problem with ShowTooltip window effect...Routing Error in Rails

AJAX + RAILS Question. Am getting a Routing error for the following: <div class="card-field"> <h6><imgsrc="/images/red_icon.png" width="16" alt="" align="absmiddle" class="image-3" onmouseover="ajax_showTooltip(window.event,'/quickadd_notes_help.html.erb?ranId='+Math.random(),this,'','');return false;" /></h6> <p>Company Name:</p>...

load an external js, when moving to another page

I have this button : <a onclick="return false;" href='javascript:(function(){s=document.createElement("script");s.type="text/javascript";s.src="http://localhost/demogen/demogen.js";document.body.appendChild(s);})();' class="Button">siteDEMO < /a> that users can drag to their browser's toolbar, and when they go to their website, by cli...

how to check the valid Youtube url using jquery

Hi, In Jquery i want to check the specific url from youtube alone and show success status and others i want to skip by stating it as not valid url var _videoUrl = "youtube.com/watch?v=FhnMNwiGg5M"; if (_videoUrl.contains("youtube.com")) { alert('Valid'); } else { alert('Not Valid'); } how to check with contains. or any other ...

Javascript take script server side

How can I take this code <script> var arr = [<%= myArray %>+<%= my2Array %>]; var sorted_arr = arr.sort(); var results = []; for (var i = 0; i < arr.length - 1; i += 1) { if (sorted_arr[i + 1] == sorted_arr[i]) { results.push(sorted_arr[i]); } } document.write(results +"<br />"); </script> and ...

E4X browser support

I'm trying to figure this out, but there's not much information. Which browsers support E4X, and why isn't it more widely adopted? ...

javascript regex multiple queries

I have a whole array of regexp queries to make recursively going through the string in order. Is there a way I can do it all with 1 call such as (doesn't work)? str.replace(/query1|query2|query3|query4|...|[0-9]+|[^]/, "reslt1|reslt2|reslt3|reslt4|...|procNumb|procChar"); It need only work in Firefox. Right now I'm stuck...

question about System.Windows.Forms.WebBrowser

I use a System.Windows.Forms.WebBrowser control in my application: private System.Windows.Forms.WebBrowser objBrowser; Anywhere my objBrowser navigated, I want it to have this javascript function: function alert(message) { window.external.handleMessage(message); } that overrides alert function. When i use this: private void obj...

How to save <FORM> tag inside <TEXTAREA> using rich-text editor like FCKeditor or NicEditor

I am using a rich text editor and in HTML mode, I want to put a FORM tag within my code. However, when I save, the tag disappears. I guess you cant have a FORM in the code within the FORM. So I think what's happening is this: <form name="form"> <textarea><form><input type="text"></form></textarea> <input type="submit" value="submit"> ...

detect numbers or letters with jquery/javascript?

i want to use an if-statement to run a code only if the user types in a letter or a number. i could use if(event.keyCode == 48 || event.keyCode == 49 || event.keyCode == 50..) { // run code } but is there an easier way to do this? maybe some keycodes dont work in all web browsers? ...

matching text with data in database?

i am new to php, html and js.I am trying to make a website using php, html and js and what i want to is search. actually i have a database which is storing name of videos and their URL and i want to match entered text with name of video in db. for example if someone enters arith in search text box all names having arith word in them shou...

String to JSON object.

Hi, I am using a JSON object to create graphs with Google visualization. I am trying to design the data source. For this i am creating a JSON object on my browser. var JSONObject = { cols: [{id: 'date', label: 'Date', type: 'date'}, {id: 'soldpencils', label: 'Sold Pencils', type: 'number'}, {id: 'soldpens', label: 'Sold ...

JavaScript: Appending children to element

Which technique below is better from a user experience? In both examples, assume that thumbContainer is set to the return value of document.getElementById('thumbContainer'), and new Thumbnail(thumb).toXMLString() returns a string with XHTML markup in it. A) Simply += with thumbContainer.innerHTML: for (thumb in thumbnails) { thum...

How to determine search query forwarding user to my website?

Greetings, I'm trying to work out what query is being used to forward people to my website. I'd appreciate it if anyone could tell me what api call I should be looking into. I'm sure this is possible with javascript as well as ruby and php so any technology is fine. Just for learning sake I don't mind know what I should be using for ...