javascript

Strange things in JavaScript "for"

Hi. I'm using jQuery and I have a strange thing that I don't understand. I have some code: for (i = 1; i <= some_number; i++) { $("#some_button" + i).click(function() { alert(i); }); } "#some_button" as the name says - they are some buttons. When clicked they should pop-up a box with it's number, correct? But they don'...

NSURLConnection and Javascript

I'm trying to log in into a web page through an iPhone app. I'm using a NSURLConnection to try to connect. The app seems to be logging in correctly but I'm then getting redirected to a page that says I can't continue without Javascript enabled. I'm running all of this through the iPhone simulator that comes packaged with xcode. The curio...

Obfuscate javascript with inline PHP?

I'm searching for a javascript obfuscator. Though I've found many obfuscators, no one so far seems to be able to handle (ie ignore) inline php code. Example of what I mean by inline php code: var my_javascript_variable = <?php echo $my_php_variable; ?>; Is this possible to obuscate, and if so, does anyone know of such a tool? ...

How to change window title from a frame in javascript?

I hosted my web app on a freehoster service which shows my webpage in a frameset. 2 frames are there. In the top narrow frame there are their ad and the bottom frame is mine. I can set the title in the admin panel but it always remains the same regardless what is in my title tag. Setting document.title in javascript not works. But if I b...

HTML and JavaScript

Problem in Firefox, but ok with Internet Explorer. I tried a lot but not solve yet. Please help me. Actually the problem over here is that, it is not in formatte order in firefox. but is displaying on in internet explorer. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>HOME</...

Programmatically control YouTube from Facebook Page App?

Hi, I'm aware of the YouTube API, and of Facebook w/ FBML/XFBML and What I'm looking to achieve is the playing/navigating of a sequence of (20+) videos, to which the user should have direct access (i.e. thumbs/links), so I don't think a playlist would suit the bill. I'd like to avoid embedding 20+ players in various visible/non-visi...

Toggle not have error but not run

I am using toggle() for 'slideshow pack information of travelle' check code here: HTML: www2.mappaturismo.com.br JAVASCRIPT: function rota() { $(".col-a div.row-a-dois:last").toggle( function(){ $(this).fadeIn("slow") }, function(){ $(this).fadeOut("slow") } ); $(".col-a div.row-a-tres:last").toggle( function(){ $(this)...

onkeypress() not working

Hi... i am trying to catch the keypress event on the window (html page opened with an app which uses gecko engine) function onkeypress(){ alert("key pressed !") } i expect this function to be called whenever any button is clicked, when the focus is on window. But the function is not been called. Any idea what is going wrong her...

jQuery autocomplete focus next control

I'm using jquery autocomplete and want it to focus a specific control once an item is selected from the autocomplete list. I tried $('#nextelement').focus(), and it receives focus, but the focus goes back to the autocomplete control immediately. How can I retain focus to the next control when autocomplete closes? [edit] I'm using autoco...

how to display date value into the textbox from opened window

hi, when i click on link, a window opened with datetime picker, i want to select the date and display into one textbox using java script. ...

Web text editor that reads MSFTEdit generated text

Anybody know of a Rtf text editor that will display "MSFTEdit" formated text in a browser. (microsoft Msftedit 5.41.15.1515) I have tried various editors but they all show the formating character strings. ...

Creating widgets in GWT and using them in My existing website

Hello everyone!! I have just started learning GWT. My question is pretty simple: If I create some widgets in GWT, lets say a Calculator widget and I want to use that widget in my existing PHP or JSP web app, then how can I do that ? I am referring the book GWT in Action for learning GWT. ...

iPhone/Android swipe detection for mobile browser

Is it possible to detect that the viewport is being dragged by a touch event? Using the following code I am able to get the position of where the finger touched the screen, what node started the event and where it was dragged to. Which solves one of the problems but I would really like to detect when the user has dragged the page/window...

jqGrid - Scrollbar missing on Safari Mobile

For the most part, jqGrid works great under "Safari Mobile" on the iPad and iPod Touch. However, I noticed that on these devices a jqGrid will not display a scrollbar if there are more items in the grid than can be displayed on the page. You can scroll with two fingers to flip through the content, however since the scrollbar is not dis...

How Do I Find the Index of An Element Within an Array

Say I have html similar to the following <ul> <li> hi </li> <li> hoi </li> <li> privyet </li> <li class="selected"> bonjour </li> <li> hallo </li> </ul> and I use jQuery to get all the li elements in the ul $("ul li") how can I get the index of the li element with the class selected within the jQuery array of li elements?...

VML CPU spiking issues

I'm dynamically creating some complex polygon VML in internet explorer 8 using javascript to overlay shapes (parcels, streets, etc) over some "satellite" GIS images. I don't have any mousemove events registered on any part of the vml layer, nor the rest of the page, however when I move my mouse around over the drawn objects, my iexplore....

Jquery UI Date Picker... only allow Fridays?

I want to only allow users to select Fridays. Basically they are choosing the start date for a schedule, and the schedules always must start on a Friday. I am not really concerned with whether the other days are displayed or not as long as if they are displayed, then they are disabled. ...

How can I get the current directory name in Javascript?

I'm trying to get the current directory of the file in Javascript so I can use that to trigger a different jquery function for each section of my site. if (current_directory) = "example" { var activeicon = ".icon_one span"; }; elseif (current_directory) = "example2" { var activeicon = ".icon_two span"; }; else { var activeicon = ".icon_...

getting a variable value in an html page and using it in an external js.

hi have a php template that displays an html page. in it there is a call to a js file that initializes some jquery plugins. on the template i have this code: (function($) { $(document).ready(function(){ var adlow = <?php echo $jSeblod->disparities_tick_lower->value ?>; var adhigh = <?php echo $jSeblod->disparities_tick_up...

XUL The Box Model layout manager and Javascript, HTML implementation?

There are many "Javascript layout manager": http://stackoverflow.com/questions/2131384/common-web-ui-styles I'm looking for lightweight, modular and HTML XUL like javascript layout manager. But, Dojo, YUI, Qooxdoo, MochaUI... not lightweight. I like "UI.Layout Plug-in" for jQuery, but it not modular. I need only lightweight layout mana...