Having trouble with what I thought was a relatively simple jQuery plugin...
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Sunday, May 27, 2012
jQuery $.ajax(), $.post sending "OPTIONS' as REQUEST_METHOD in Firefox
Sunday, May 13, 2012
Firefox innerHTML Bug?
I have a simple piece of HTML
<p id="skills">Skills</p>
in Firefox 3.6.3 when I call (with JQuery):
Friday, May 4, 2012
Secret copy to clipboard JavaScript function in Chrome and Firefox?
In the console windows of both Chrome and Firefox on Mac I can execute
Sunday, April 8, 2012
Dialog Click listener not triggering in IE8 or Firefox with jQuery
I have this click listener and for some reason it's not triggering in IE8 or Firefox:
console.log("listener attached");
jQuery(".ui-button-text").click(function() {
console.log("this should have triggered");
var ajaxUrl = '/ajax.php?popup=true';
var dataString = "param="+param+"¶m2="+param2;
// contruct the ajax request
jQuery.ajax({
url: ajaxUrl,
dataType: 'json',
data: dataString,
beforeSend: function() {
jQuery(".ui-button-text").html("Saving...");
},
complete: function() {
jQuery(".ui-dialog-content").dialog("close");
},
success:function(response){
}
});
});
So I can see the "listener attached" in the console, but I don't see the click trigger, this works in chrome, what am I doing wrong here?
Thanks!
UPDATE: I have tried using live("click", function()... instead but it's not triggering
UPDATE: So another Update, I should mention that the content of this dialog is acquired through a separate page. It's loaded with AJAX, this dynamically loaded content contains this click listener.
UPDATE: Here is the code that loads the content, please be aware I didn't actually write this piece of code, so I don't fully understand why its done the way it's done here:
<!-- START OF NEW WINDOW POPUP -->
jQuery('.option_window').click(function(){
var url = jQuery(this).attr('href');
var title = jQuery(this).attr('title');
jQuery('<div />').dialog(
{
autoOpen: false,
width: 720,
title: "Manage Code",
modal: true,
buttons:{
"Save and Return":function() {
var self = this;
var popupForm = jQuery("form.submit_on_close");
//if( jQuery("form.submit_on_close").attr('action') != '#' || jQuery("form.submit_on_close").attr('action') != '') {
if(popupForm.attr('action') != '#' || popupForm.attr('action') != '') {
jQuery.ajax({
url: jQuery("form.submit_on_close").attr('action'),
dataType: 'json',
data: jQuery("form.submit_on_close").serialize(),
success: function(data) {
data = eval(data);
if(data.resp == "success") {
var obj = jQuery('#repl_activation_row');
obj.unbind('mouseover');
if( data.property_code > 0) {
if( obj.hasClass('codeoff') ) {
obj.removeClass('codeoff').addClass('codeon');
}
} else {
if( obj.hasClass('codeon') ) {
obj.removeClass('codeon').addClass('codeoff');
}
}
}
jQuery(self).dialog('close');
}
});
}
else
jQuery(self).dialog('close');
}
},
//title:title,
open: function(event, ui){
jQuery(".ui-dialog").delay(600).queue(function(n) {
var topPos = jQuery(".ui-dialog").offset().top;
var finalPos = topPos - (jQuery(".ui-dialog").height() / 3);
jQuery(".ui-dialog").css("top", finalPos);
n();
});
var self = this;
jQuery.getJSON(url, {}, function(data){
jQuery(self).html(data);
});
},
close: function(event, ui){ jQuery(this).dialog( "destroy" ); jQuery(this).remove(); }
}).dialog('open');
return false;
})
<!-- END OF NEW WINDOW POPUP -->
And here is the link:
<a href="/popupmanager.php?code=3212&client=4432" class="actions option_window menulink">Manage</a>
Source: Tips4all
Tuesday, February 14, 2012
About the BLOB datatype in MySQL
I have stored an image in MySQL using the BLOB datatype. I am able to retrieve image through JSP but when I use Chrome or Firefox browser I am unable to view the image. It is displaying in an encrypted format. Can anyone please help me?
Friday, January 13, 2012
Can we capture the same browser closing event without using “onunload”
Actually using the window.close , we can control whether browser is closed or not, but it works only for pop-ups created by the browser.
Wednesday, January 11, 2012
How can you control window focus in Firefox?
I'm trying to open a pop-up window but keep the opener window in focus. This is pretty easy in everything except Firefox.