javascript

problem with jquery ui`s autocomplete select callback (1.8)

With this code: function setupRow(event, ui) { var textbox, // how do i get to the textbox that triggered this? from there // on i can find these neighbours: hiddenField = textbox.next(), select = textbox.parents('tr').find('select'); textbox.val(ui.item.Name); hiddenField.val(ui.item.Id...

How to access an instance variable inside a Javascript function in Ruby on Rails application?

I have a form for editing profiles. Rails automatically generates the form id as 'edit_profile_##' where ## is the profile id of the current user(instance variable-@profile_id). I need to use this form id for my javascript functions. Is there a way to get the current user's profile id inside js? Or is there a way I can override the autom...

Graph API features

What features does Facebook's Graph API support? I have already incorporated publishing messages. Can I get: Online list of friends. Chat Profile Pictures ...

EXE from JavaScript

Possible Duplicate: How can I run a program or batch file on the client side? I am new to JavaScript. I am trying to execute an EXE file from JavaScript on the web browers. How can it be done with simple code? ...

Allowing embedding of HTML to other pages. Iframe-, Script-tag?

I need to allow other people to embed some of my HTML and Javascript code. The HTML code itself is too much to be copy&pasted. Should I use Iframes or script-tags for embeding it? The script tags and iframes are used for example by Stackoverflow on Flair page How does those even exactly work? Aren't those a security risk? What method...

Looking for better hack....

Hello, I have page for which I want to load different template file for different browsers. Example : If browser is IE then load 1.tpl & If browser is other than IE load 2.tpl [ Here .tpl is template file having respective content & css ] I tried using conditional tags : <!--[if IE]> {include file="/templates/1.tpl"} <![end...

Facebook query Language

Dear all, How can i use FQl(facebook query language ) in my application to 1)GetOnline friends 2)Get Images 3Upload Photos and more features ...

how use global variable in javascript for main and newwindow

Hi, I have two jsp(one is main page, another one is new window) and single javascript file. MainPage and New Window have 'Test' , 'ClickedCount' buttons. First, I click 3 times in MainPage 'Test' button . Then i open New Window. Now , i click 2 times in newWindow 'Test' button. So totally i clicked 5 times. each time i click, i co...

how to call a javascript function from my controller?

Hi I have a form in my view page on submit a function in a controller called function Login() is called This is my Login function function Login() { $EmailId = $this->input->post('mailId'); $Password = $this->input->post('password'); $res=$this->friendsmodel->CheckLogin($EmailId,$Password); if($res==true) ...

(Javascript- HTML Parser) Can be html parsed with javascript without server languages?

Hi, Can html be parsed with javascript without server languages? my webpage should do : parsing of all images from the url that user enter. Can I do it only with Javascript if yes with library functions that exist doing that? Thanks, ...

How to switch the web browser to fullscreen mode with JavaScript?

Hello, I'm developing a web application and to improve the user experience I wish to switch the browser in fullscreen mode. Any ideas how to do this (except asking the user to do it himself)? ...

Is it possible to retreive the MS / Latency from a "GET" request? (Javascript / Jquery)

I am at the moment making some getjson requests with jquery. They are get requests: "GET http://localhost/MySite/JSON" Now you can watch the requests fire in firebug. Then they return a "200 OK 250ms". I would like to be able to display something similar on my page itself. So the user can see the latency for themselves. Image found vi...

why does several javascript libraries use $ for one or other use.

I have seen several javascript libraries using $ be it jQuery , mootools , prototype etc also even some of the books on javascript recommend using $ as a function replacement of document.getElementById. is it just a random thing. ...

Setting the value of a checkbox based on what is selected in a list

I am working in the confines of a CMS system, which defines certain fields which can be used to make forms for use within the application in PHP. The list function has the signature: function inputBasicList ($id,$value = "",$list = array(), $displayName = NULL, $displayLabel = true) I use it thusly: $theinput = new inputBasicList("t...

Javascript - Confirmation when leaving page

Hi, I'm trying to implement a basic popup window that asks the user if they really want to leave a page, similar to what would happen on this site if I tried to close the window half way through writing this message. I realise this is something that is generally frowned upon but I have good reason for wanting to do it. I have got it wo...

jQuery AJAX problems, intermittently getting duplicate requests

Right then, I'm coming to the end of a rewrite of our JavaScript system, we're moving from Prototype to jQuery. We have a load of AJAX requests that fire when a certain element events occur, the one in the example below is a new event on a calendar, but it happens elsewhere too. The problem I'm getting is when an event is fired sometime...

Using Jquery, how do you update a row of an HTML table with the contests returned from a url?

In the following code, I have a div around each row in a table that I would like to update periodically. With this code, I can call a url passing the id for each div as a parameter and get back the correct replacement html for the row from my server. Unfortunately, once I get the html back, I am unable to figure out how to properly repla...

Have the parenthesis in the javascript expression "(p) ? 1 : 0" any effect?

Take the following javascript: var x = (p) ? 1 : 0; p can be any value. It there any situation the parenthesis can have effect? If so: please provide examples. ...

Looking for a JS Calendar

Hello I am looking for a Javascript/PHP based open-source calendar that can be used to select a date range. If anyone can recommend a good solution for this task, let me know! Requirements in the Ideal world: Use the current day as the starting point Allow dates to be chosen in week blocks rather than days. (i.e. you could choose Mo...

looping in two directions

hey I'm looking for are clean solution to this problem: i start the loop with i = 0 in the second loop step the i = 1, then i = -1 and then i = 2 ect. how to programm this with a for loop in a clean way? ...