javascript

how to get the last word ('wwww') of this url using javascript

the url is "http://127.0.0.1:8000/maps/map/wwww/' how to get the last word thanks ...

Help transcoding simple jQuery to mootools

$(".container").hover( function(){ $(".child-1").hide(0); $(".child-2").show(0); },function(){ $(".child-1").show(0); $(".child-2").hide(0); }); A project I have requires that I use mootools, but I never used mootools, and jquery makes much more sense to me. Can someone ...

Using Components.utils.import in a firefox extension

I am trying to create some global variables in a firefox extension. In my content folder, I have two javascript files: 1) Main JS file that holds the functions for the different events, etc 2) A file that stores only an object with the pieces of state I want to maintain. Also, I set the array EXPORTED_SYMBOLS. I am having issues with ...

Simple form validation. Object-oriented.

Problem statement: It is necessary for me to write a code, whether which before form sending will check all necessary fields are filled. If not all fields are filled, it is necessary to allocate with their red colour and not to send the form. Now the code exists in such kind: function formsubmit(formName, reqFieldArr){ var c...

jQuery find last input and append

I am trying to append an image after the last input field in a div, any ideas as to why this won't work? $('<img src="img/loading.gif" id="loading_img" />').appendTo($(form).find('input:last')); ...

correct function parameters designation

Every time i pass some parameters to a JavasScript or jQuery functon, i use some random letters. What are the correct letters for the corresponding variable types? function(o){} for example is for a object. But what are the other letters? Do someone have a list of those? ...

Trouble using Prototype JS

I have three files named like: AjxDm.php db_test website.php What I am trying to do is AjxDm.php in this file I click and I am using Ajax.Request and it directed me to the db_test.php. In this file I am retrieving a value from the database and I assign the value into a dropdown. Again when I try to select one of the options in the d...

Autoscrolling a DIV element

Hi, I have an auto overflowed DIV on my page, what i want to do is to make it start scrolling slowly towards the end of items of the DIV on page onload. is that easy u think ? ...

.jsm vs .js files

I am creating a javascript module for a firefox extension. I curious if the extension made a difference. In the examples I've seen, it looks like either one it ok and I wanted to make sure. Thanks ...

Can a single javascript file be used by multiple html files?

Hi friends, I have a javascript file main.js and five html files 1.html,2.html,3.html,4.html,5.html I want to access the javascript file main.as in all files . I have used in all of the five but I'm not able to access it . Is it possible to share the .js file among the html files. Plz reply, Thanks in advance Prashant Dubey ...

Find by values in JavaScript Array

I have such an array: arr['key1'] = true; arr['key2'] = true; arr['key3'] = true; ... arr['keyN'] = true; How to determine, have anyone key a "false" value? ...

Do not fetch app.manifest each time

For creating an offline version of a bunch of linked web pages I use an app.manifest-file that lists all the web pages for offline caching. I would like it that the app.manifest file is not fetched every time when a user jumps from one web page to another. Most of the web pages will never be updated once the application is on the iPhone...

Javascript global variable not working properly?

My jQuery code: $(document).ready(function() { chrome.extension.sendRequest({get: "height"}, function(response) { height = response.value; }); $("#id").css("height", height+"px"); }); You don't have to be concerned about the chrome.extension.sendRequest(), basically it communicates with a background page to fetch ...

call a server side python script from javascript

how to call a server side python script from javascript. if test.py is the python script file in server, and if the parameter to be passed to python is another url , then how this can be executed from javascript, how the return string from python script is obtained to the javascript. ...

Is it possible to open a new frame in html bellow an existing frame in HTML?

Hi friends I have a html main.html as given ----- main.html---------------- <title>FlexTrail</title> <script src="main.js"></script> <frameset rows='200,200'> <frame id='one' src="file:///C:/Documents%20and%20Settings/demo/Desktop/FlexTrail/project1/bin-debug/project1.html" frameborder='0' /> <fram...

Executing <script> elements inserted with .innerHTML

I've got a script that inserts some content into an element using innerHTML. The content could for example be: <script type="text/javascript">alert('test');</script> <strong>test</strong> Problem is that the code inside the <script> tag doesn't get executed. I googled it a bit but there were no apparent solutions. If I inserted the c...

How to pass a Javascript variable to Rails Controller ?

Hi Inside my index.html.erb <script type= "text/javascript"> var msg = "Hello World" ; </script> i need pass this var msg to my controller say get_variable() method in my Post controller. Edit : get javascript variable msg in same index.html.erb as ruby variable Thanks in Advance ...

browser compatibility

Hi, How can i check which fuctions of javascript the browser support which i am using.It can be any browser. Thank you in advance. ...

Evaluating Javascript Arrays

I have an array that contains an array of arrays if that makes any sense. so for example: [[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6]] I want to see whether an array exists withing the array, so if [1, 2, 3] is duplicated at all. I have tried to use the .indexOf method but it does find the duplicate. I have also tried Extjs to loop th...

ExtJS Data Grid Column renderer to have multiple values

Hi, I am wondering if it is possible in ExtJS to have several values of the data source available to the renderer of the column. For example with the "Actions" column, the id is passed to the renderer. However I require both the user_id and id passed to the render. How may I do this? table_cols = [{ header: "User ID", width: 3...