javascript

Detecting touch screen devices with Javascript

In Javascript/jQuery, how can I detect if the client device has a mouse? I've got a site that slides up a little info panel when the user hovers their mouse over an item. I'm using jQuery.hoverIntent to detect the hover, but this obviously doesn't work on touchscreen devices like iPhone/iPad/Android. So on those devices I'd like to r...

Javascript img onload

Hi! I have something like this: <img class="side_image right" id="side_image" src="http://path/to/file_large.jpg" width="300" height="210" onload="document.getElementById('loading_gif').style.display = 'none';" /> My problem is how to tell if the image does not exist. This block of code will hide the loading gif only if the image is...

jQuery ajax tries to send cross domain and gets 403 foribben but its on the same domain

Im trying to do an ajax call to my php file on the same server. I found a url fetching script similar to Facebook to get links. http://wakeupzee.netai.net/99points/facebook_url_extracting/ Works pretty good actually. Anyway, I want to save the info it's extracting to the DB. When I pull the src of the img link, somehow Im getting a 403 f...

$.post does not submit data

$("#contact-us-form").submit(function () { var nameVal = $("input[name=name]").val(); var companyVal = $("input[name=company]").val(); var titleVal = $("input[name=title]").val(); var emailVal = $("input[name=email]").val(); var phoneVal = $("input[name=phone]").val(); var messageVal = $("input[name=message]").va...

Web Browser control is not loading images

I have a webBrowser Control. HTML inside webBrowser control displays some small images (4kb each). However when I run my application, Images are not loaded in to webBrowser Control. Also I have used javascript function to keep refreshing page at some interval. function StartTimer(MS){ TimerObj = setTimeout("window.location.href=windo...

Image wont render on my aspx page after adding master page..if not changed ID ..what else could be the reason?

used the following code to get rid of the system generated ID:- Banner.ascx.cs protected override void Render(System.Web.UI.HtmlTextWriter writer) { StringWriter Html = new StringWriter(); HtmlTextWriter Render = new HtmlTextWriter(Html); base.Render(Render); writer.Write(Html.ToString().Replace("id=\"ctl00_ContentPlace...

JS Combine Arrays

Im trying to combine 2 arrays in javascript into one. var lines = new Array("Line1","Line2","Line3"); lines = new Array("Line5","Line6","Line7"); This is a quick example, i want to be able to combine then so that when the second line is read the array can be used as lines['4'] (returning "Line5") How would i do this? ...

Javascript memory management in functions

Example code below; function a() { var a = 123; //some stuff b(); } function b() { //some stuff } a(); So my question is whether the variable 'a' is in memory while b() is executed ? Thank you. ...

catch url by javascript

catch url by javascript ...

Best way to keep HTML that will be used for the future

Hello I am curious what would be the best way to keep HTML data that won't be displayed at the initial render however will be used for the future. For instance for tabbed navigation, I need to keep all HTML but not sure what would be the way to achieve it. I can think of: Keep them at some javascript array. Keep them as display:none a...

Update drop down selection with radio button selection using jquery

So this is a follow up to this post. I need to replace some dropdown menus with radio buttons without modifying the HTML. In the post I linked earlier, someone came up with a really clever Jquery solution that successfully replaces the dropdown menu with radio buttons and updates the dropdown selection when one of the radio buttons is se...

What's Wrong with Age Range Script?

I am working with the script that will be checking the age from the current date and very simple logic that is by taking year input. Here is the code: <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Date Check</title> <script language="javascript" type="t...

Multi language for a Website (php and javascript)

Hi, i try to build a language selection for my Website. I use php and Javascript. My idea is to create for every language a php file. For example: lang_en.php <?php $lang = array(); $lang[1] = "Everything is ok!"; $lang[2] = "Please select a Number."; ?> <script language="JavaScript" type="text/javascript"> lang = new Array(); ...

Take User Input Value and Redirect

Basically, I have a search box. Once clicked, the value within the search box would be sanitize and then redirects as a Get Var rather than a Post. I have one method of taking the User's Input value and redirecting to what they want to search (But it turns into a Post Method). I want to achieve the following: User Input Value: "I am ...

How to do this in a new window?

location.href = "/search.php?key=" + encodeURIComponent(key) + "&type=" + type; I want to reserve the original window ,how to do it in javascript? ...

execCommand not working

I am unable to get document.execCommand('SaveAs', false, "/home/prakash/temp/log.html") to work in either Firefox or Google Chrome, any ideas ? Am I doing something wrong ? ...

Conversion of SVG to Jpeg

Hi..i want to convert SVG into Bitmap Images likes (Jpeg, PNG etc) through javascript...Please help me out..Shall be very Thankful...any help will be awesome Reagrds: Zain ...

make a simple login page

hey all.. i want to make a simple login page. I have prepared two textfield. <input type="text" id="user"> <input type="password" id="password"> <input type="button" id="go"> i want after click #go script can check: if #user value != "admin" then #password value != "qaubuntu" will show and JS alert. but if data same, will show som...

Javascript link in aspx page within a SharePoint frame replaces apostrophes to #39 element

I have problem with SharePoint encoding the javascript link, that normally renders like href="javascript:Function('url');" but in Sharepoint like href="javascript:Function(& #39;url& #39;)" wich of course does not work. What do I need to do? I need to be able to use my user control as stand alone as well as linked into a sharepoint pag...

how to set content-disposition = attachment via javascript ?

can I set content-disposition = attachment via javascript. Basically, I would like to force a "SaveAs" operation after a page has loaded via Javascript, using Firefox. How can I do this ? ...