javascript

Can someone explain this seeming inconsistency in jQuery/Javascript?? (trailing brackets inconsistency on reads)

So, in my example below, "InputDate'" is an input type=text, "DateColumn" is a TD within a table with a class of "DateColumn". Read the value of a discreet texbox: var inputVal = $('#InputDate').val(); Read the value of a div within a table.... This works: $('#theTable .DateColumn').each(function() { var rowDate = Date.parse(...

How do i POST/Submit a form using Jquery?

From This answer and the fact i may be using an anti pattern I thought i should change the ajax call into behavior like submitting a form. I found $.post but that seems to be doing ajax and does not change the page i am on. How do i submit a form with jquery or plain JS? ...

facebook content only need this script ???

<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> <div id="facebook"> <fb:login-button onlogin="facebook_onlogin();"></fb:login-button> </div> <script type="text/javascript"> FB.init("5dbe0d9768c26d9b553f394b3e4ac644", "xd_receiver.htm"); </script> when i cli...

Rails: 'if running locally' conditional javascript tag include

I want to load jQuery from http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js regularly, in production/development environment, as long as I'm not running locally, but my own local jquery.min.js if running locally (e.g. 0.0.0.0:3000) Reason why is that I have to do some development without internet connection sometimes, mo...

Rerendering partial view at a JavaScript event in Ruby on Rails

I would like to rerender some partial views in Ruby on Rails at a specific JavaScript event. Do you guys know how I could do that? More specifically, i have some custom in-place-editor fields (from my own helper based on scriptaculous), and I would like to update some partials whenever new values are submitted on the fields. I do have a...

This javascript fails on mouseover

can anyone figure out why this JavaScript won't work? It correctly generates the document.write output, but when you try to drag it it starts complaining about top and left not being set. any idea whats wrong? abilitynames=new Array('Heal','Slash','Stab','Poison Slash','Knockout','','','','Tornado','','','','','','','','Icespike','','',...

method chaining in mootools using delay for fade effect

Hi, I want to use method chaining in moo tools 1.2. My requirements are as below. When page load complete. My one div element say "my_div" is set to hidden visibility. After half second its opacity set to 0.4 Then again after half second its opacity set to 0.7 Then again after half second its opacity set to 1. So how could i do th...

Flex - JavaScript works on bin-debug, but not on deployed server

Hey everyone, My Flex application is successfully calling functions in a JavaScript file through the ExternalInterface class when these are in the bin-debug folder and the JS file is located in the same directory as the Flex app. But when I test the Flex app on the server, it is not interacting with the JavaScript. The only difference...

Modify Gridview as it's being rendered through javascript

I'm trying to modify a field in each row of my gridview as it is rendered. I need to modify it with client side Javascript. I'm somewhat new to asp.net, but I think I should be doing something with clientscriptmanager. I came up with a simple scenario which is basically what I want to do to avoid getting bogged down in the details. ...

Flex - How do I get the absolute X and Y coordinate including HTML offset?

Hey everyone, I am calling a JS function through the ExternalInterface using Flex which requires the absolute X and Y coordinates to create a pop-up menu. The Flex application is displayed on the center of an HTML page, therefore there is an HTML X and Y offset to consider. I have tried using the LocalToGlobal and ContentToGlobal funct...

Is the google docs embeddable previewer out of beta and will it have an have an API?

https://docs.google.com/viewer is awesome, but there are some customizations I need to make, and documentation would be helpful. Discovered here http://googlesystem.blogspot.com... . Haven't seen any public documentation that would help. http://code.google.com/apis/documents/overview.html covers the Google docs - where the above is mor...

How do I embed a quicktime movie into an iphone web app using javascript?

I'm creating an iphone webapp in dashcode for the first time and I can not figure out the code for embedding a video into the webapp.I have an html file and have a few pages it switches between but I need to create a function in javascript so when I click a button that it will pull up a video I in quicktime. Any sample code or thoughts? ...

javascript, just like stackoverflow's comment preview

Hi, I need to do a preview just like how stackoverflow does their preview such as when you write questions or add comments. ...

how to set continous text scrolling in marquee?

I have a simple text "Hi this is developer this side" Now i want to set a marquee scrolling in it such that when this text scrolls from right to left then as soon as the text ends from that point only this text should start again without giving any blank space.That is continuous scrolling of the above text without any blank space.I have...

Strings split in javascript?

i am using my_colors.split(" ") method, but i want to split or divide string in fixed number of words e.g each split occurs after 10 words or so ...how to do this in javascript? ...

How to pass parameters to javascript function within a struts tag?

something like this: <s:iterator value="list" status="status"> <s:textfield value="%{list_item}" onchange="js_func(this, **status.index**)"/> <s:/iterator> I wanna pass the index of status to js_func but fail to do that. any suggestion? ...

replace character (space with &nbsp;) across whole webpage using javascript/jQuery

Hi, So I figured out that the replace function, that finds all single-letter "words" (prepositions and conjunction, etc.) and replace the space after them with a &nbsp; to prevent leaving these characters at the end of line, should be something like myString.replace(/\s\w(?=\s)/,"$1&nbsp;") Now how do I apply it to all text on a webp...

How do I embed a quicktime movie into an iphone web app using dashcode?

I have a functional webapp that I have created through dashcode, but I want to add a video by clicking a button. Any idea on how to code a handler to do that or any sample code? thanks here is what I have but it wont do anything in the simulator function myClickHandlerVideo(event) { var vidElem=document.createElement("video"); ...

Counting the number of visitors for a web page - JavaScript and Struts

Hi i am Dhananjay, I need to keep track of the number of visitors to a web page. I have planned like this: on load of the home page, I will call a javascript callCounter(); From javascript, I need then to call an action and update a record in database. Please help me with this. How do i call the action? I should be in the same home ...

Why "space" is not supported in the ajax post method?

hi , Below is my html <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> <script type="text/javascript"> function Data_Check() { var xmlHttp; try { xmlHttp=new XMLHttpRequest(); } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); ...