javascript

User Interface in different language for WYSIWYG

The WYSIWYG for web we have only has English Interface. For Japanese language Interface what will be the appropriate steps to make it. In future, it may requires the other language support. I am planning in this way- For Japanese language setting, in the .js file var language={ "bold":"太字のテキスト", "italic":"斜体文字", .....

How do you register mouse events on area tags using the parent element?

I have figured out what was wrong. The highlight layer ended up covering the area tag. I thought I had it set up so it wouldn't do this, but obviously I didn't. Note to anyone wanting to know. Layering of area tags is based on where in the html the image is not the code for the map. I have some area tags and instead of registering a...

how to get flash's url, height, width in a HTML web page?

I am new to Web C++ programming. I am trying to use IE8's IWebBrowser2 interface to obtain a webpage's embedded flash's url, height, width information. This flash can be generated by javascript. So I did like this: from IWebBrowser2 I got IHTMLElementCollection,then I iterated through the collection to get IHTMLObjectElement2,and finally...

Calling two javascripts functions onClick

Presently i have the following code on one of my web page- <a href="http://ex.com" onclick="return popitup2()">Grab Coupon</a> now I want to run one more script which is used in the following way - onClick="recordOutboundLink(this, 'Outbound Links', 'ex.com');return false;" Now can someone tell me how do i call both of these javacs...

Special Characters in Regex Brackets

Let's say I want to match one of the following characters: a, b, c, or + (in JavaScript). Do I need to escape the +? Is it /[abc+]/ or /[abc\+]/? Both work in my limited selection of test browsers. Which is (more) correct? ...

Problem while handling alerts/confirms on web page through java(gargoyle)

Hye everybody I'm here to get some help on a problem. Currently I'm working on a login web page which gives alerts and confirm on submitting the user details, I had to automate the login through java. As I had tried my hand on many othe web pages earlier with gargoyle API through code which worked well for other things but now got stuck...

How does google "change background image" link work ?

When I look the source of this link, there is just this function javascript:void(0) and there is nothing else, I looked for usage of javascript:void(0) but there is not much place where it is used alone. So what is the secret ? ...

resolve prototype & jquery conflict with dynamic script loading.

Hi, I know that I can use <script type="text/javascript"> jQuery.noConflict(); </script> to resolve the conflict between prototype and jquery after including all jquery and prototype libraries in the head section. However, I am including another .js file in the head section which dynamically loads a jquery plugin in window.lo...

Why usually <form> used to aggregate elements and not <div> in case when form working with ajax submit event?

Hi, Why usually <form> used to aggregate elements and not <div> in case when form working with ajax submit event? Ajax jquery function: $('#parse-form').submit(function() { $.ajax({ url: 'controller.php', type: 'POST', dataType:'json', success: function(data) { a...

How to solve a problem with base tag?

I have a problem with base tag. It looks like <base href="http://myexamplepage.com/myfolder/" />. Everything works, besides this query: $.get("application/soft/calendar_month_change.php", ...) My computer thinks it's cross domain server and changes query to OPTIONS .... When I remove the base tag, it works correctly but my site doesn'...

is any onmousescroll / onmouserollover event exist?

Hi, is there any onmousescroll / onmouserollover event exist in javascript / asp.net on picklist or select control. I want to implement/attach this event on the picllist of CRM lead form's onload. I will do that. But want to know is any such kind of event exist or not? ...

ASP.Net MVC (1) - how can I pass JSON to view but not as separate ajax call...

I have some data that I want to pass into the View (.aspx page) in JSON format. I could add an async ajax call and load it that way, but since I have the data upfront, why not just dump it into the view. I could pass a C# object as the model and in Javascript manually iterate through it to fill out a Javascript object, but this seems l...

Why I can't alert somethings on the browser?

I have a login method, I would like to say a alert, when the user success login... This is the remote form: <div id="login"> <%if logged_in? %> <b><%=current_user.login%></b> <%=link_to "Signout", logout_path%> <%else%> <% form_remote_tag :url => session_path do -%> <p><%= label_tag 'log...

2D game algorithm to calculate a bullet's needed speed to hit target?

I have a rather simple bird's-view 2D game where tower sprites defend against incoming moving sprites by shooting a bullet at them. My question: How do I calculate the needed bullet speed for the bullet to reach its moving target, provided that the bullet will always have the same defined speed? I'm using JavaScript and have these sprit...

Detect pasted text with ctrl+v or right click -> paste

How to detect what text the user pastes in textarea with JS? ...

Javascript does not work in Opera - strange

Hi All, have a javascript code to exec on a page - all works fine in Firefox, IE, Chrome but does not work in Opera 10+. Strange is that this javascript works fine in previous versions of Opera (9.xx is fine) and even more strange is that when I lunch Dragonfly on Opera 10+ the javascript works also fine (and Dragonfly does not throw...

Use jQuery method as callback parameter

I have this little jQuery plugin: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head><title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; <script type="text/javascript"><!-- (function($){...

Can anyone help me with drag and drop functionality of files using javascript supported by all versions of IE?

Hi I have text box. when I drag and drop a file into it, the path or content of the file should be displayed. the major concern being it's compatibility with all versions of IE. I am a beginner in javascript programming. can anyone suggest any idea or some tricks to get through? It's very urgent. ...

Invalid argument error with an AsyncFileUpload inside a modalpopupextender

Hi, I receive this error when the page loads: Invalid argument. On this line: a._innerTB.style.width=a._inputFile.offsetWidth-107+"px" If I remove this attribute UploaderStyle="Modern", I don’t have the error. Also, if I use the control without the ModalPopupExtender, I don’t have the error as well. Do you have an idea how can I res...

JQuery Ajax Request returns no data

Hi, I am trying out JQuery Ajax methods. I wrote a simple Ajax request to fetch certain 'tagged' photos from Flickr. Following is the snippet I am using: function startSearch() { $(function() { var tagValue = $("#tagInput").attr("value"); alert(tagValue); $.ajax({ url: "http://ap...