javascript

Modern browsers break same origin policy?

According to this video http://www.facebook.com/video/video.php?v=562087699610 modern browsers break same origin policy so javascript can make ajax calls to whatever domain. Is this true? If yes, does this mean that this will be natural/acceptable whenever necessary eg to fetch data from my partner applications? ...

Javascript rounding issue

I've got a weird maths/rounding problem in Javascript. The snippet below is a very basic example of the code I'm running. Obviously it's not this exact code, but I'm taking a decimal value from a text box, working out a percentage and taking this away from one. var ten = "10"; var eight = "8"; alert(1 - (eight/ten)); The problem is ...

how to import a .Jar file in Java Script

I want to import a .Jar file in Java Script, there is a Class in the Jar file which i want to use in Java script,and here is a code i found but couldn't get it work yet ! var cl = new Packages.java.net.URLClassLoader( [ new Packages.java.net.URL('http','My Ip', '8080', 'Hello.jar') ] ...

iBooks highlight style for buttons on website

Hi there, I want to implement a special highlighting to by buttons. The one, I found on the iBooks app for iPhone/iPad suites my needs. I think it is very complex due to the fact that all the strokes are looking different. I could use some CSS-Sprites-Voodoo but I don’t think I will be able to assign these styles so easily. Has anyone d...

how to prevent postback by javascript.

actually this code is working well in firfox mozila but it's not working in IE8 <asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="btnPrimary" OnClientClick="return doSubmit('this');" OnClick="btnSubmit_Click" /> <script type="text/javascript"> function doSubmit() { ...

What's the current status of Javascript ES5?

What browsers / engines already support ES5 [strict]? ...

with (window) {} doesn't work for new pop-up window in IE

I open a window, and want to perform some calculation on some condition. Problem is in IE, only first call of test (from ready) is performed from new window, but subsequent calls of test (set with setTimeout) are executed in parent window and not for new window (i.e. win). It works fine in FF. illustrating code (this code is in paren...

display the song in listview but it's not working

hai, i want to display many song using list view now i am create but its not working some problem in my coding help me what mistake i made when i run the emulator will display The application mexample (process mexample.mexample)has stopped unexpectedly. please try again my log cat error is 10-27 21:26:36.847: INFO/ActivityManager(...

How to receive a string array variable from String array variable of Form in javascript

i am having an attribute of type String array. i have to get the values of that variable in javascript defined on same page to check its validation. ...

accordion if/else logic

Hi. I'm guessing my if/else logic is skewed. Basically I have an accordion structure where, on page load, the first accordion pane is half-revealed to a height of 150px. Then when the user clicks on the accordion header it fully opens to a height of 320px. On the next click it should close and act normally like the other accordion elemen...

Problem with removing child

I have two drop down forms. When the first is "changed" the second is populated with some data via ajax. It's work but the value of the second drop down is not cleared on every request (I'm using $('#second_drop_down').children().remove();) Here is sample code $('#first_drop_down').live('change', function() { var x = "some ajax dat...

Expand selected text by one word

The TextRange object of IE has expand function through which you can expand the text selection to complete the word or sentence. It only works for IE. More: http://www.webreference.com/js/column12/trmethods.html It would be great if someone can help me and make it work cross-browser. ...

is my code victim of same origin policy ?

Here is my code. You have to kindly look does it suffer from 'same origin policy' in this shape. The domain for HTML is (http://127.0.0.1/jqload.html) & php file (http://127.0.0.1/conn_sql.php). This is json format : [{"options":"smart_exp"},{"options":"user_int"},{"options":"blahblah"}] I actually want to append json data that I rece...

Get value of <a> using PHP.

Okay, so now I am confronted with a new problem, and I just don't know what to do next. I have a table where the contents of it is dynamically added from a database on page load, and each item in the table is a link. The link looks like this: $ct->data[$key][3]='<a href="allthread.php?sessid='.SID.'&product='.$ct->data[$key][0].' '.$ct...

Javascript: call a specific function on function complete

Hi, I have a slow function that does an AJAX request: function X(param1,param2){ var params={ type: "POST", url: "./ajax/useful.php", data: "param1="+param1+"&param2="+param2, success: function(msg){ //do something } }; var result=$.ajax(params).responseText; } Everything works fine when I call X("asdf",...

please extract a bit of info from this string (without regex so that i can understand it)

Hi, On my web app, I take a look at the current URL, and if the current URL is a form like this: http://www.domain.com:11000/invite/abcde16989/root/index.html -> All I need is to extract the ID which consists of 5 letters and 5 numbers (abcde16989) in another variable for further use. So I need this: var current_url = "the whole p...

jQuery: how to print out the text label of radio buttons?

If the code is <form> <input type="radio" name="font"> Arial</input><br> <input type="radio" name="font"> Times New Roman</input><br> <input type="radio" name="font"> Monaco</input><br> </form> <script> $('form input').each(function(i, e) { alert($(this).text()) }) </script> It shows 3 empty strings. How can it sho...

Advantages/Disadvantages on developing iPhone apps with Appcelerator Titanium instead Apple development.

Hi, I have a new project which is an iPhone application. for that I have 2 possibilities to build it: using Apple classic style (xcode, objective-c, etc) using Appcelerator Titanium and continue using javascript as an interface to access all the iPhone features to create my app. *I've noticed the absence of a separated interface fil...

unable to refresh a page when i use setInterval() and pass in a function that uses document.write to output some javascript to the page

basically i have a blank html page that includes a javascript file, and in the javascript file i have this: function doIt() { document.writeln("asdf"); } // could also be setTimeout setInterval("doIt()", 5000); When the html page loads, it waits 5 seconds and then will output "asdf" every 5 seconds to the screen. If i hit refresh or...

jsp does not display whole animation

when i keep all jsp files in foo folder then jsp show all the graphics, images, css, jquery animation etc. all working fine in foo folder. but i want to keep my all jsp's in jsp folder which is outside of foo folder. it show all the graphics but it does not display jquery animation.e.g when i keep the cursor on a row of table it does no...