javascript

How to access an html element in flash?

I have an html page with a flash movie embded in it, that flash movie contains a button. I want to pass the id of an element on the containing html page to the flash movie so that when the button is clicked, I get the text of that element in flash (i.e. innerHTML). So, my question is basically two questions: How to pass something from...

Is it possible to make two .click method calls in javascript

I have the following javascript code: function ClickButtons() { document.getElementById('Button1').click(); document.getElementById('Button2').click(); } only Button2 seems to be clicked. If I reverse the order of the statements then only Button1 (which would be called 2nd then) seems to work. FYI (don't think this is impactin...

how to generate tinymce to ajax generated textarea

Hi, i have a image multi-uloader script which also each item uploaded was preview 1st b4 it submitted and each images has its following textarea which are also generated by javascript and my problem is i want to use the tinymce editor to each textarea generated by the ajax. Any help will be appreciated.. here is my script function file...

Firefox back button works only the first time, not the second time

Hi, I have a website where you can search on stuff with dates and more. When I post the form I get to a result-page, when I hit the back button I go back to my search-page and will refill the values. This works in IE and FF. however, whatever I do, when I search and go back again the second time, the values are lost in Firefox, while I...

how do call different css for corresponding browsers like using jquery

This is already asked http://stackoverflow.com/questions/848227/how-do-call-specific-css-for-specific-browser-using-jquery I want to use one css file for safari and other for Mozilla and other for IE ...

Call from JavaScript to server-side code in JSF

Hi, I'm looking for an easy way to call a bean's method that will take no parameters and return a string in JSF. The thing that I don't really need is that the method returns an action result and then uses the whole JSF life-cycle to do get me to another view. I need to do that from JavaScript so that I can put together some client-side ...

Display current line and column number for a textarea.

I'm making a file edit interface in my web-app, I have a textarea with file contents. When textarea is focused, I want to output the position of the cursor, i.e. line number and column: this is useful because error messages usually yield a line number, for example. The question is: how do I figure out the position of the cursor in text...

Google chrome link stylesheet tag at runtime

I'm adding a CSS link tag at runtime, it works in all the browsers except for chrome, which simply refuses to use the CSS, Its a PHP script file in which a header('Content-Type: text/css;); has been added as follows var css; css = '<link rel="stylesheet" type="text/css" href="http:/domain.com/cm.css?c=someval"/>'; $(css).appendTo("body"...

Variable scope in onclick attribute with Javascript

Hi, I'm using Prototype and trying to dynamically access a variable in a loop. Code speaks better than me : for (var i=0;i<5;i++) { $('parent' + i).insert('<input type="button" value="Cancel" onclick="$('parent' + i).remove()" />', {position: 'after'}); } The problem is that "i is not defined" when I click on any of the Cancel bu...

How to handle cookies in JavaScript ?

I am working on a project where it requires to check cookie and tell whether it is 20 minutes old or not. So I have written once code which is like this. This is only javascript code I have pasted. function checkcookie() { var difftime= getcookie(); // further operation comes here } var cookieminutes; function getcookie() { ...

Accessing CascadingDropDown from javascript

Can i change the WebMethod of the Cascading on a client side event? ...

visibility:collapse in javascript

Hi, I'm using Ultrawebgrid for my applcation: I'm using a textarea for listing the errors in my application in the row template when the user clicks that particular row... So I need to have texarea when there are any errors..... otherwise when there are no errors i dont even want the row_template to pop up..... I'm using IE6. I'...

IE WebControls TreeView - web application javascript problem

I am using the old Microsoft.Web.UI.WebControls TreeView control. When running under a web application the treeview.GetChildren() method through an 'object or proerty not supported error', yet the same code in an asp.net 2.0 website project runs fine. Has anyone encountered this issue? There is almost nothing on the web about this cont...

Perform JavaScript .replace in JQuery

How would I perform the following in JQuery? var elmOperator = document.getElementById(elm.id.replace('Include', 'Operator')); The ID that is being manipulated would look something like Criteria[0].Include. I am trying to create a variable for a related ID which is Criteria[0].Operator. Thanks in advance! ...

clientside localisation

I have a colleague who thinks this alert('<asp:Localize ID="ErrorAddingComponent" runat="server" Text="There was an error adding component: " meta:resourcekey="ErrorAddingComponent"/>' + errortext); is a good idea if we get an error from an AJAX call, the errortext is the parameter of the function called on error from a jquery ajax, ...

Internet explorer equivalent for loading a text file in javascript

I wish to load some additional data from javascript in an HTML page. The solution below is small and does exactly what I need to do in non-Microsoft browsers. Question is, what is the Microsoft explorer equivalent? Note that the data I'm loading isn't in XML. I also do not wish to add a javascript library - I want this page to load fas...

How to assign null value to Hidden variable in javascript?

I have a hidden input variable called str. I am assigning "abc" value to it. Then I try to assign null value or let's say null reference to it. But I couldn't. Edit part of code. Hidden Field... <input id="str" name="str" type="hidden" value="" /> I also use jQuery. if ($(str).val() == "abc") { $("#str").val(null); ...

Flash External Interface issue with Firefox

I am having a hard time getting ExternalInterface to work on Firefox. I am trying to call a AS3 function from javascript. The SWF is setup with the right callbacks and it is working in IE. I am using AC_RunActiveContent.js to embed the swf into my page. However, I have modified it to add an ID to the Object / Embed Tags. Below are o...

UpdatePanel initial call

I am using an UpdatePaenl in an asp.net page. It has a button to trigger it. I'm able to show "Loading" when the button is pressed. Here's my issue: I need it to show "Loading" when the page is first called, not just when a button is pressed. I would imagine that JavaScript would be used to trigger the UpdatePanel when the page is fir...

Calling window.open opens a window, but then it suddently gets minimized

Hi, I make a call to window.open which opens up the desired URL, but then the window suddenly gets minimized w/o my interaction. Why is this? Update The window was being opened on a onclick event (asp.net) and I then injected the HTML. A linkbutton control was used, now when I converted it to a asp:button it is not minimizing. wierd...