What happens in jQuery when you remove() an element and append() it elsewhere?
It appears that the events are unhooked - as if you were just inserting fresh html (which I guess is what happening). But its also possible my code has a bug in it - so I just wanted to verify this behavior before I continue.
If this is the case - are there...
I develop Joomla websites/components/modules and plugins and every so often I require the ability to use JavaScript that triggers an event when the page is loaded. Most of the time this is done using the window.onload function.
My question is:
Is this the best way to trigger JavaScript events on the page loading or is there a better...
I have created a fairly large Javascript app that works in Firefox and up until yesterday, IE. I've made quite a few changes and now I'm getting syntax errors in IE, but all is fine in Firefox. Obviously I have a trailing comma somewhere but I can't see it. IE's error message is less than helpful, not even telling me which JS file has th...
I need to pass a variable that php is aware of to my javascript code and I'm wondering what the correct way to do this is.
I already know that I could add this to the page generation:
<script type="text/javascript">
var someJSVariable = <?php echo $somePHPVariable ?>
</script>
But I find this method to be more obtrusive than I'd like...
I want to populate form fields with values from a database immediately after the user enters a value in the #sid field. Here is my jQuery/HTML example:
<script src="jquery-1.3.1.min.js"></script>
<script type="text/JavaScript">
$(document).ready(function()
{
$('#sid').bind("change", function(){
$.getJSON("test.php?sid=" + $("#sid...
Firefox handles it fine, but Safari and IE7 silently fail and do not insert the element.
<script type="text/javascript">
var ul = document.getElementById('xg_navigation').getElementsByTagName('ul')[0];
ul.innerHTML = '<li id="xg_tab_home" class="xg_subtab"><a href="http://somedomain.com/">Some Text</a></li>' + ul.innerHTML;
</scr...
self.close() working fine in IE but not in Mozilla, anyone know what to coused this issue? and how can I solve it?
...
JSON allows you to retrieve data in multiple formats from an AJAX call. For example:
$.get(sourceUrl, data, callBack, 'json');
could be used to get and parse JSON code from sourceUrl.
JSON is the simply JavaScript code used to describe data. This could be evaled by a JavaScript interpreter to get a data structure back.
It's genera...
Hi,
Are there any differences between single and double quotes in javascript?
...
if i want to test the result of an expression and the function would return NaN
how would i check that?
examples: $('amount').value.toInt()!='NaN' ^ does not work and i assume that the returned value is not a string,
$('amount').value.toInt()!=NaN^ doesnt seem to work either and this one seems obvious
so how do i check wether the returne...
I'm trying to get a bit of code working. I'm using xfade, latest version. Homebrew Javascript image fader that fades between all img tags in a div, assigned by the Javascript. There's an image fade script I found that uses Javascript to fade between images in a div. However, it can only fade 1 div...I have 3 spots I want to have fading i...
I have a textbox control Super1 in my MasterPage.
I am using javascript to access this control from my content page like this:
<asp:Content ID="ContentPage" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
function Somethin() {
{
document.forms[0].elements['Super1'].valu...
In IE with document.getElementById("css_id").styleSheet
or in Firefox document.getElementById("css_id").sheet
I've a style sheet object to manipulate but in Chrome and Safari
browser that property there is not.
How can I get that object?
Thanks
...
Hi guys,
I was wondering, are you aware of any best practice for specifying absolute URLs in external javascript files? I'm looking for a maintainable solution.
The basic scenario is when i need to include css files at run-time through javascript, or make ajax calls to some URL, and other situations where you would normally need to spe...
Hi,
I'm wondering if someone can point me in the right direction. I've got an ASP.NET web application. And there's autogenerated portion of JavaScript in every page that handles postback. Sometimes that javascript is surrounded by
<[CDATA[ ... ]]>
, while on the other machine it may be enclosed in simple HTML comment like
<!-- .....
Is it possible to call the base method from a prototype method in javascript if it's been overridden?
MyClass = function(name){
this.name = name;
this.do = function(){ //do somthing };
};
MyClass.prototype.do = function(){
if (this.name === 'something'){
//do something new
}else{
//CALL BASE METH...
This is mostly a rhetorical question, as far as I've checked the answer is 'don't even bother', but I wanted to be really sure.
We have an email app, where you can send email to lists of subscribers. This is not spam: it's used, for example, by an university to send communications to its students, by a museum to send emails to subscribe...
So what I want to do is to coordinate some effects using jQuery for some AJAX calls that I'm working with. My problem is that the fadeIn for the second div fires at the same time with the fadeOut for the first div.
This could apply to other events as well so I'm curious, is there any way to make fadeId launch ONLY after fadeOut is done ...
I want to show to the user a state that the result is loading.
How can I change cursor or gif while loading result in div with $MyDiv.load("page.php") ?
...
Why do you need JavaScriptResult as a response?
Doesn’t it break the pattern of clean separation of concerns? Can you suggest me some cases where this will be useful?
...