javascript

Inheritance Object method in IE

I've defined method fadeIn for Object Object.prototype.fadeIn = function(d, callback) { //some code here }; .... var b = documentGetElementById('b1'); // <div id="b1"></div> b.fadeIn(); It works in FF, Opera, Chrome, but IE reports "Object doesn't support this property or method" when I try launch fadeIn. Why IE doesn't inherit my ...

Displaying single image from a multi-image (animated) GIF file

Simple question, really. I just don't have the knowledge to do this with JavaScript, and to also make sure it works with (almost) all browsers... I am going to design a set of images of a person pointing with one hand in several directions. (Up, down, left, right, diagonal, etc.) Basically, this puppet will be pointing at the location of...

Looking for a WYSIWYG web editor

I am looking for a WYSIWYG editor for my intranet users. It should not show or give them a html option, instead it should have buttons for stuff like bold, italic, bullets, comments, font colour, html links, etc etc. Which WYSIWYG editor would be best for these needs? ...

simple ajax question

Hello guys, I have to send mail before submitting my php page, I am submitting the page using javascript. my mail script is in sendmails.php file. so can I send an ajax request to send mail before submitting the page using java script ? like follows function submit_page() { //trying to run send_mail.php ............................../...

Spot the ball game, zooming problems, jQuery

I am trying to create a spot the ball game, so it will (eventually) be an image of a player kicking a ball but the ball has been removed and the player needs to click where the ball should be. The first version went well and works. http://enjoythespace.com/sites/game/test.html But what I need to add is some sort of zooming so you can ...

how to place videos into infowindow of google map

I have written the following code to display images and contents on the google map ,how can i place some sample video in one of the tab. function createMarker(point, name, address, imagepath) { var marker = new GMarker(point, gicons[imagepath]); //var html1 = '<div><a href="#" class="DataHead">' + name + '</b></div> <br...

Rhino: How to call JS function from Java

I'm using Mozilla Rhino 1.7r2 (not the JDK version), and I want to call a JS function from Java. My JS function is like this: function abc(x,y) { return x+y } How do I do this? Edit: (The JS function is in a separate file) ...

Ajax script stop itself

Hi! I'm working on script taken here to load a page in div but the script starts to run and in middle al funtions stop itself. If I move the lines of code up it run the first new lines and then it stops. My code is: function loadDemo(path) { $.get(path, function(data) { alert("Chiamata la funzione get per " + path + "!"); data = d...

How to retrive value from object in JavaScript

Hi i am using a Java script variable var parameter = $(this).find('#[id$=hfUrl]').val(); this value return to parameter now "{'objType':'100','objID':'226','prevVoting':'" // THIS VALUE RETURN BY $(this).find('[$id=hfurl]').val(); i want to store objType value in new: var OBJECTTYPE = //WHAT SHOULD I WRITE so OBJECTTYPE co...

Calling JavaScript function from code beind (c#) catch block

Hi, I am trying to call a JavaScript function from my ascx control code behind in the catch block. I have tried the below two ways but they don't seem to work. Page.ClientScript.RegisterClientScriptBlock(typeof(string), "script", "test();", true); ScriptManager.RegisterStartupScript(Page, GetType(), "err_msg", "alert('error');", true)...

Load local image into browser using JavaScript?

Hi all, I'm currently developing a solution for a web-to-print, poster printing application. One of features I'd like to include is the ability to 'edit' (crop/scale/rotate) a given image, before proceeding to order a poster of said image. To avoid the requirement of the user uploading the image to a remote server before editing, I'd ...

How can a child browser window change the window's properties?

I'm working with a software package that creates Flash panorama .swf's. The package allows the creation of hotspots in the pano. You can specify the URL and the Target of the hotspot, so if you click on the hotspot it launches the URL in _blank, _self, etc. However, the package doesn't allow you to specify the attributes of the window. ...

Update global variable from another module in javascript?

How do I achieve it? I have a module named "tooltip" which has a "fade" function which in turn uses a global "element" variable. That variable is a reference to an element of the DOM. I want to update it from another module named "lightbox" so I could just let the "fade" function handle the fade-in effect. All my modules are declared u...

JS associative array with duplicate names

ok, so I have an array like: var myarray = { "field_1": "lorem ipsum", "field_2": 1, "field_2": 2, "field_2": 6 }; as you see there are duplicate names in the array, but with different values. If i go through it like (using jQuery): $.each(myarray, function(key, value) { console.log(key); console.log(myarray[key]); ...

Firefox doesn't know what to do when something null appears while building a URL

Hi I am facing an issue here as shown in code is mentioned below Inside the function I have something like this AJAXRequest("getActivityEntries?orgEntry="+orgentryid+"&activity_entry="+activity_entry+"&target=AJAX"); if orgentryid is null here, After building the HTML page, the JAVAScript looks like… AJAXRequest("getActivityEntri...

jQuery Right-Click Context Menu Help!

http://pastebin.com/YyDzQ4Bk this is a plugin for right click context menu, anyone know why it doesn't work in IE? Not only that, it's breaking many of my other jQuery things, such as fancy box and some jQuery hover functions. ...

Synchronous message passing in chrome extensions?

I'm trying to block a script file from loading on user defined websites. To block a script file I'm using beforeload event and event.preventDefault(); in content script which works fine as long as I already know website list. My problem is I don't know website list in advance, so to get the website list I'm sending a request to backgroun...

jQuery("#portfolioslide").data("AnythingSlider") is null

I have created a static HTML page with anythingslider to show sliding portfolio works. In that static HTML page it works just fine. Now I am trying to convert this page to a WordPress template page. At first, I just copy contents of the static main container page (excluding header and footer) and it stops working. It gives me an error jQ...

Making a button unclickable until jquery .load() has finished

I'm currently using the following code for my read more buttons: $(document).ready(function() { $("a.more-link").attr("href", ""); $("a.more-link").attr("onclick", "return false;"); $('.readmore').each(function(index) { var $link = $(this); $(".readmore").prependTo('.' + $link.attr("id") + ' > #bottominfo'); }); $(...

Javascript manually firing .onchange() event

I have an input field I want to assign a new value and fire an .onchange() event. I did the following: document.getElementById("range").value='500'; document.getElementById("range").onchange(); Where range is my input Id. I get the following error: Uncaught TypeError: Cannot read property 'target' of undefined Is there a way to def...