javascript

Ensure jquery and FB JS SDK are both initialized

I am using the FB.ui method to publish something to the users wall and want to capture whether the user published or cancelled. To do this I am calling a function (say bi_published(){...}) which updates a table in the db which is being used to capture metrics. It does this by making a $.ajax call. The issue is bi_published has to be with...

How to check if a page is exist or not using javascript

Hi, I have a link <a href="http://www.example.com"&gt;Hello&lt;/a&gt; when i click the link it should check the page is exist or not.If exist goes to that page(www.example.com) or if the page is not exist redirect to another Page. ...

javascript url of a popup

Hi, I start a popup with window.open("link","name"). I don't have control on the popup. The popup it's then redirecting to another link. How can I get the final link of the popup ? The final link it's on another domain. with popup_window_object.location.href I can set the link but I can't get it. Thank you. ...

FB.login issue, need to show lightbox instead of pop-up, Javascript SDK, iFrame Application

Hi, I am developing a facebook iFrame application which would be embedded inside a facebook page. I have chosen iFrame as FBML is deprecated by facebook. My application is ready but I am facing a small problem when FB.login is called, a popup window appears. My application requirement is that whenever its loaded, it should check whethe...

Global variables between files in Node.js?

Here are 2 files: // main.js require('./modules'); console.log(name); // prints "foobar" // module.js name = "foobar"; When I don't have "var" it works. But when I have: // module.js var name = "foobar"; name will be undefined in main.js. I have heard that global variables are bad and you better use "var" before the references. B...

Remove first character from a Javascript string

I have the following string: ,'first string','more','even more' I want to transform this into an Array but obviously this is not valid due to the first coma. How can I remove the first coma from my string and make it a valid Array? Get something like this: myArray = ['first string','more','even more'] Thank you. ...

sIFR and Javascript; sIFR won't show

Hi, I'm using sIFR on my website and all works like a charm. Now that i'm working on a contactform, i would like to use sIFR for the errormessages. For instance, if someone forgets to fill in a required field and presses the Submit button, the errormessage shows up. The hiding and showing of the errormessages is done by Javascript like ...

Can I conditionally change the character entered into an input on keypress ?

Is it possible to change the character which has been entered on keypress, without doing it manually? For example, if I want to force uppercase letters based on some condition, it'd be nice to do the following: function onKeypressHandler(e) { if ( condition ) { e.which -= 32; } } But of course that doesn't work. ...

Display a random item from an xml list

I've been looking all over, and I can't find a clean solution (that I can make sense of). How can I pull an entry at random from an xml list? My starting point is as follows (which pulls the latest entry): <script type="text/javascript"> var xmlDoc=null; if (window.ActiveXObject) {// code for IE xmlDoc=new ActiveXObject("Microsof...

Are there any better javascript org charts compared with Google Org Chart API?

We are using this to display our org charts, but we need something that supports: One person showing up in multiple places in the org chart One permission reporting to multiple managers Co heads of a functional areas. Are there any competing tools that give better support for the above. ...

How to remove Main Domain cookie from Sub Domain

is it possible to remove Main Domain cookie from Sub Domain ?I am using single sign on .On logout i want to remove the maindomain cookie ...

checking the page exist or not using javascript

How to check the page is exist or not using javascript. ...

IE7 window.open when .focus return null

Hi, I'm trying to do something like this win = null; win = window.open('/url/to/link','tab'); win.focus(); but in IE7 it returns me at the line of win.focus(); the error that win is null. How can I solve it? Thanks in advance! ...

Why i am unable to set z-index of div using jquery?

I have created a sample http://jsbin.com/eqiti3 here we have three divs. Now, what i want to do is: on clicking of any div it should come on the top of other div then fade and then back to its original position. This is what i am using: $(".box").click( function () { var zindex = $(this).css('z-index'); /* this too is not wo...

Jquery follow scroll

I have a sort of sidebar on my website, which has to scroll down together with the user so that it is always in the view. The code I'm using now is actually working fine however there is one problem. On smaller screens the sidebar scrolls before your at the sidebar thus making it impossible to see it all even if you scroll. So what I ...

checking the page exist or not using javascript and ajax

Possible Duplicate: How to check if a page is exist or not using javascript can you provide the code for checking the page exist or not.if not,it will redirect to another page. ...

Subscribe to javascript event in an iframe (facebook)

I have an application where I use an iframe for a facebook likebox. I want to subscribe, in the main page, to the event when the user clicks on the like button in the iframe. Basically as soon as the user likes the page I want him to be redirected to a page I'll specify. What javascript command can I use? Thanks ...

How to include javascript dynamically in this real world example ?

I read here it is possible to inlcude js dynamically http://www.phpied.com/javascript-include/ I wanted to try with this real example by concerting tigra slider example (see http://www.softcomplex.com/products/tigra_slider_control/multiple_slider_designs_demo.html) into dynamic code using http://accessify.com/tools-and-wizards/develope...

jquery getting all dropdown values

I have dropdown <select> with id my_dropdown. I allow multi-select. I know how to pull the selected value(s) using jquery: var values = $('#my_dropdown').val(); This will return an array of values if I select multiple. I also need to get all the values in the dropdown regardless of what is selected. How can I use jquery similarly ...

Let a function "return" the super function?

Hi, Given is the following code: function two() { return "success"; } function one() { two(); return "fail"; } If you test the code by calling function one(), you will always get "fail". The question is, how can I return "success" in function one() by only calling function two()? Is that even possible? Regards ...