|
The whole question fits in the title. And to add some context: I'm not asking what is the best according to what the specs are saying, but rather what works the best given the mix of browsers deployed nowadays.
Some data points:
Google uses text/javascript...
Started by Alessandro Vernet on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Text/javascript....
It has been "text/javascript" but this is obsolete (see the IANA List ) and now it should be "application/javascript" (see another IANA List ).
With application/javascript , which is also recommended by an RFC.
|
|
Is Graceful degradation possible for everything? for every javascript and javascript frameworks functionality?
Started by jitendra on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
There comes a point when you have to decide if you can support a feature with or without javascript start with a non-javascript....
There are a lot of cool things that can be done with javascript, but with some thought things can.
Then it is.
|
|
Hi all,
My application's JavaScript is working on Firefox and IE but it is not working in Google Chrome. Is it problem of enable javascript in Google chrome? or I must put any code in javascript for getting XMLHttpRequest Object of Google chrome browser...
Started by ashish bhatt on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
What is it that doesn't appear to be working?
There is a Javascript Console in Chrome, press Ctrl.
Google Chrome's Javascript engine interprets JS very similarly to the other browsers mentioned.
|
Ask your Facebook Friends
|
Hello, is it possible to call c# functions with javascript parameters (from javascript)?
i.e.
<script> function someFunction() { var data = "123"; var test ="<% AppHelper.GetSomething("+data+"); %>"; } </script>
Thank You !
Started by vbobruisk on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Or you might have a look at server side javascript , ....
If you want to communicate with the server using javascript, you need to use something like AJAX.
No, because ASP.NET code is run and compiled before you get to the javascript.
|
|
When building a link that has the sole purpose to run javascript, is it better to:
<a href="#" onclick="myJsFunc();">Link</a>
Or
<a href="javascript:void(0)" onclick="myJsFunc();">Link</a>
Started by 2cBGj7vsfp on
, 26 posts
by 26 people.
Answer Snippets (Read the full thread at stackoverflow):
Just make sure to return false to prevent the click event from... .
The javascript:void(0) but in your onclick event try to end it with return false;
The first one, ideally with a real link to follow in case the user has JavaScript disabled.
|
|
How to call javascript onmouseout event in javascript code?
I.e.:
var div=document.getElementById('new'); if(div.mouseout) document.getElementById('new').style.visibility='hidden';
Thanks.
Started by Hulk on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I think you want:
var div = document.getElementById("new"); div.onmouseout = function (e) { this.style.visibility = "hidden"; }
window.onload = function(){ var div=document.getElementById('new'); div.onmouseout = function(){ this.style.visibility='hidden... .
|
|
Hello,
Is it possible, something similar to @import in css. Is it possible to include a javascript file inside a javascript file?
Thank you for your time.
Started by Alec Smart on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Function includeJs(jsFilePath) { var js = document.createElement("script"); js.type = "text/....
This will load targeted js file.
It is possible dynamically generate javascript tag and append it to HTML doc from inside another javascript.
|
|
Please, share your tips and tricks related to JavaScript coding. The ones which make code more elegant and faster.
See also:
http://stackoverflow.com/questions/61088/hidden-features-of-javascript
Started by Koistya Navin on
, 11 posts
by 11 people.
Answer Snippets (Read the full thread at stackoverflow):
Use of a library such as jQuery
Check if an object is not empty // JavaScript 1.5 function isNotEmpty(obj) { for (var tmp in obj) return true } // JavaScript 1.8 function isNotEmpty(obj) obj.__count',11] } foo('aa', 11);
JavaScript....
|
|
I have a PHP file and it holds a value in this session variable: $_SESSION['image_value'].
I want this session value in a JavaScript function. Actually, I want to match a string in my JavaScript function with this session value.
Anyway I can do this?
Started by RPK on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
That variable will be set when the page loads and any javascript modifications ....
You could use json_encode():
<script type="text/javascript"> var image_value = <?php echo server-side and javascript is entirely client-side.
|
|
Hi All,
How to pass value from Javascript to PHP and get return of PHP back to Javascript function
I am having HTML page which will have Javascript function which should call PHP (php is another file)
for example like
function JavaCallphp() { test = Validate...
Started by Ankita on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
If ....
Use an asynchronous HTTP request in the JavaScript to load the output of the PHP script can't just do it in a browser as JavaScript has no PHP interpreter and neither do most browsers, and so can't just run a PHP file to get output.
|