Hi,
i'm working in a big and rich rails web application using tons of javascript. I would like to know if anybody has a tip to organize the javascripts. Today i'm generating a new file named controller.js and adding it to my views using content_for. The problem is, some files are becoming big and sometimes, i need a function from one co...
I didn't use Prototype.js before, when I use jquery, I can get an element value like $("#inputA").val();
Is there an equivalent method in prototype like this? I use $("inputA").getAttribute('value');, which is very verbose.
...
I'm developing an iPhone application in Titanium, and need to append a row to a particular TableViewSection. I can't do this on page load, as it's done dynamically by the user throughout the lifecycle of the application. The documentation says that the TableViewSection has an add method which takes two arguments, but I can't make it wo...
What will be the regular expression in javascript to match a name field,
which allows only letters, apostrophes and hyphons?
so that jhon's avat-ar or Josh is valid?
Thanks
...
How to be a jQuery no.conflict expert?
I mostly face jQuery conflict errors with Prototypes JS. and I'm nota jquery expert.
Can I still solve all conflict problems. how to get expertize to solve conflict issues.
How to know whole code is jquery. what if simple javascript and jquery code mixed in one js file?
What if inside external j...
Hi Folks,
I guess anything important you might have to know is within the title.
If I use the Google Ajax WebSearch API with, for instance, "Dummy Search" as phrase, my resultset is a different one than if I perform the same phrase over google.com.
How can that be?
My querystring paramter options are exactly the same, language etc.
T...
Hey,
I am creating a website in Ruby on Rails. I have a controller action that renders a view like so:
def show
time_left = Time.now.to_i - 3.hours.to_i
@character = current_user.characters.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @character }
end
end
This is f...
Hello,
I use SVG inisde my xhtml file. I can not get access to the text with id="Wert".
What is wrong, I want to change the color form blue to red.
Untitled Page
<script type="text/javascript">
function OnLoad() {
setTimeout("timer()", 1000);
}
function timer() {
var randomnumber = Math.floor(M...
I have the following ajax call which works perfectly in Firefox and Chrome but not IE:
function getAJAXdates( startDate, numberOfNights, opts ) {
var month = startDate.getMonth() + 1;
var day = startDate.getDate();
var year = startDate.getFullYear();
var d = new Date();
var randNum = Math.f...
Is there any way to handle exceptions thrown from AJAX callbacks in jQuery, other than adding a try..catch block to each callback? The error function is not called in this situation.
$.ajax(
{
url: 'myurl.rails',
success: function( data )
{
throw 'Oh no!';
},
error: function ( xhr, textStatus, errorThrown )
...
Is there a way in IE Browsers to access the Flash object? In this case it is made with mootools swiff. It´s working fine in all other browsers, because they can wrap this object correctly. But it does not work in IE.
Here is the script:
var swfObj = $('mbImage').getElement('object');
swfObj.get('data'); <--- Thats not working in IE
...
Is it possible to have a navigation system optimized using javascript, but for the sake of search engines, have the hyperlinks still be crawlable?
Or maybe a condition statement that calls HTML code only if javascript is not enabled in the browser or when crawled by a search engine?
...
I have the following JavaScript JSON array of real estate home objects:
var json = { 'homes' :
[
{
"home_id":"1",
"price":"925",
"sqft":"1100",
"num_of_beds":"2",
"num_of_baths":"2.0",
},
{
"home_id":"2",
"price":"1425",
"sqft":"1900",
"num_of_beds":"4"...
Hi to all!
What is the javascipt code that will edit a text on double click. The process is I have a text and if I double click it, a text box will appear, and if I press enter the word will change depends on what you've type.
Sample
This is sample text. $nbsp;$nbsp; --> if I double click it a textbox will appear.
<input type="text" va...
I have:
var f1 = function(a){
alert(a)
}
var f2 = function(data, method){
method(data) // the problem is here,
// the method f1 is not called. Is there a way to call that method f1?
// the method f1 might not be in this scope, the method f1 can
// be in a class or like this...
}
f2(a, f1)
The question is: Is t...
I'm currently building a HTML/JS AIR application. The application needs to display to the user a different 'window' - dependant on whether this is the first time they've launched the application or not. This part is actually fine and I have the code below to do that:
if(!startUp()) { // this simply returns a boolean from a local prefere...
var editing = false;
if (document.getElementById
var buttext = document.createTextNode('Ready!');
butt.appendChild(buttext);
butt.onclick = saveEdit;
}
function catchIt(e) {
if (editing) return;
if (!document.getElementById || !document.createElement) return;
if (!e) var obj = window.event.srcElement;
els...
http://stackoverflow.com/questions/1564566/using-jquery-to-add-or-remove-form-elements/
when i click the add link the information in the existing input field disappears.
How do i tell it to retain this information.
...
Hi
I have a problem with Open Flash Chart 2.
It works like it should in FireFox, but in Internet Explorer my Y axis is all wrong.
No matter if I set the "steps" or not, it is not accepted in IE. Then it just takes my "max" and creates 5 steps with some weird numbers like 11.6, 23.2, 34.8, 46.4 and 58.
Why?
My JSON that I pass to OFC2 l...
I have an HTML table that contains lots of rows and columns. Therefore, it has vertical and horizontal scroll bars.
How can I get the dimensions in pixels of these scroll bars in Javascript/jQuerys ?
...