javascript

Test for functions names in javascript script (SpiderMonkey engine)

I am embeding SpiderMonkey (mozila javascript) interpreter/engine in my C/C++ application. i programatically loading a javascript script and want to test (from my C/C++ code) if a certain function exist/defined in this script. is there a way to do that ? maybe a way to list all functions in a given script ? Tnx, Vertilka ...

Facebook friend selector with counter

I am trying to get a friends selector working, the only thing is I don't want to send out invitations, I just want a count of the friends the user has selected. I need to take this value and apply it to some javascript code that will update a span on the page. I have spoken to Uncle Google, and he couldn't help. ...

javascript asynchronous

Hi Guys, I have 3 javascript methods. isLogin(); login(); reply(); when I'll execute the reply method then first of all it should check that user is Login or not. If user is login then execute the reply method. If user is not login then execute it first and then execute reply method. These are all Facebook Javascript SDK methods whi...

problems in creating a flyout/sidebar menu

Hello all, I need some css and syntax help,please. Your help is warmly welcome. I want to insert a list containing some skypelinks and behaving like a sidebar menu when I move the mouse over the image. This is the html-code I tried to manipulate: <a href="?USER=name"> <img src="../../name.jpg?format=raw" title="full name - skypena...

Cross domain ajax fails even for a local file

I have a local html file with an ajax function trying to pull a xml content from x.com. The file when run works only on IE and fails on firefox and safari browsers. Ofcourse this may be because of the Same origin policy. But,I have heard from someone that for scripts loaded using file:// protocol,this same origin policy will not apply. I...

How to re-register common javascript events in Rails after an Ajax request

Hello everyone, I'm writing a Rails app which includes ajax functionality using jQuery. I hope you guys could help me out here. For example, in my /public/javascripts/application.js : /* application.js */ ... $('.item-edit').editable('/item/update', { name : $(this).attr('name'), id : $(this).attr('id'), cancel : 'Can...

Removing a text from tinymce editor using javascript

I have a text <info>SOME CONTENTS GOES HERE</info> How i can remove this text from the editor when I click on a button (custom button) using javascript function. I used this code: dom.remove(dom.getParent(selection.getNode(), 'info')); But it is showing an error. Is there any solution? Thanks in advance. ...

Get elements in jQuery where "x" attribute = "y"

How can I change the attribute of an element, depending on another attribute? For example, I have 2 <a> elements. They both have the class myClass. One of the elements has rel="1" and the other has rel="2". I wish to only change the z-index on the one which has rel=1. How do I do this? I've tried: $(".myClass[rel='1']").css("z-index",...

Jquery dialog to open multiple windows

I'm trying to make system of multiple dialogs in one page using jquery dialog... Functions looks like... function open_w(id){ $('.opened').dialog('close'); $(id).addClass('opened'); $(id).dialog({position: 'center', modal:true, width: '750px' }); }; function close_w(){ $('.opened')...

Access function from background page in Chrome extension

In my background (background.html) page I have the following js: function capturePage(){ chrome.tabs.captureVisibleTab(null, function(img){ var screenshotUrl = img; chrome.tabs.create({"url":"history.html"}, function(tab){ var t = tab; var addImage = function(){ var view = chrome.extension.getViews()[0]; ...

Dojo - finding out which button was clicked on submitting a form

Hello, If I connect to my form's onSubmit event, how can I find out which button on the form was used for submit? Or, if the form was submitted by pressing the Enter key on an element, how can I find out which element was in focus? I cannot rely on ExplicitOriginalTarget property of the event object, as this is Mozilla-specific. Any s...

Onclick in select not working in IE

Hi guys, Am a bit new to javascript. This question might sound a bit too silly, but I'm not able to figure it out why the following doesn't work in IE and works in firefox.. <select multiple="multiple"> <option value="tx" onClick="alert('tx');">Texas</option> <option value="ak" onClick="alert('ak');">Alaska</option> <option value="ca...

Window.OnBeforeUnload

I am trying to create a customisation to our existing software, which launches on this event. I need to be able to catch the window.onbeforeunload again once the user has made their choice. I have tried wrapping the functions but can't seem to be able to overwrite the one which is loaded first. Does anyone have any ideas about how I can...

Fill in a textbox when other textbox get filled.

Hi, I have a form with a few textboxes which are used for calculations. When I enter a value in one textbox, I want the other textboxes to get filled immediately when a value is entered. I want to use JavaScript for this. How can I do this when my textboxes are server-side? ...

javascript:how to write $(document).ready like event without jquery

in jquery $(document).ready(function) or $(function) , how could I do the same thing without jquery, and I need browser compatiable, and allow to attach more than one function. Note: dom ready!= window onload ...

How to use JS to trigger a GIF animation?

I have an animated GIF that plays once (doesn't loop). I would like it to animate when clicked. I tried something like this: $('#plus').click(function(){ $('#plus').attr('src',''); $('#plus').attr('src','img/plus.gif') }); With the hope that quickly resetting the src would trigger the animation, but no luck. Anyone know ...

how to dynamically create elements in a child window from a parent window

im trying to dynamically create elements in the child window based on the values i have in the the parent window but no success.The child window is opening but not with the elements.Here is the code i've written,could some one please have a loot at it ? is this possible at all using javascript/jquery> function fnOpenPrint(){ openPrint...

Javascript exit full screen swf

Trying to exit fullscreen of a swf using javascript. Managed to do so by hiding the showing the player. With jQuery, like this... $('.player').hide(); $('.player').show(); Was wondering if there was a better way to do this? Thanks Edit: also I'm using swfobject if that helps in anyway. ...

How to add &ref=123 every link

How would i be able to put the follow on the end of every link of my website with out editing every link? e.g www.WebsiteName.com/?ref=123 so if i went to www.WebsiteName.com/aboutus.php i want it to add ?ref=123 onto the end of the url. ...

JavaScript: set dropdown selected item based on option text

say I have a dropdown list like this: <select id="MyDropDown"> <option value="0">Google</option> <option value="1">Bing</option> <option value="2">Yahoo</option> </select> and I want to set the selected value based on the option text, not the value with javascript. How can I go about doing this? For example, with c# I can ...