LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-20-2013, 11:53 AM   #1
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Rep: Reputation: 12
JAVASCRIPT: Program Quit because => Error: NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN:


Hi,

I have a long running program that has inexplicably quit running. I run Ubuntu 13.04 and jquery 1.7.js. I'll try a brief explanation first.

I generate a select list from a partial name submitted by form.

1. Enter partial name on form and submit.
2. Program produces select list of qualified names.
3. Pick option(name) from select list.
4. Program shows (used to) table of data for associated name.

The trouble is in the showing of the generated data. The data no longer shows up. I have tried running firebug on this and it is acting weird also. It starts to run and just quits.

For instance; Firebug just stopped when running my file 'load.js' no error shown - does not have console option listed like it usually does.

Any help solving this would be appreciated.

R.

Code:
// ===================== This is my 'load.js' file ===============================

$(document).ready(function() {
$(function() {
$('#getPartName').one('submit',function() { showValues(); return false; }); //.one is one time only, could be .bind
});
function showValues() {
var searchName=$('#partnm').val();
//alert(typeof searchName);
if(typeof(searchName)=="string" & searchName=="") searchName="All Names";
var str = $("#getPartName").serialize();
//alert(typeof str, str);
$(".results-box").fadeIn();
$(".results").html("Result of Name Search for <span style='color:red;'>"
+ searchName + "</span> : Click on Your Choice for Data");
$(".results").append('<div id="addrsNames"></div>')
//.children("#addrsNames").hide()
.load("makeSelectList.php #addrsNames", str , function() { //
//$("#partname").remove();
$("#addrsNames").show(); //.slideDown("slow");
addSelectChange();
}); // function
} //show values
}); // doc ready

// ================ function addSelectChange() ==================================

function addSelectChange(){
$('select').one('change', function(){
var mySelection= $("option:selected", this).val();
//alert("my selection", typeof mySelection, mySelection);
if(mySelection) {
window.location.href="ContactInit.html?Display_Name="+ encodeURIComponent(mySelection);
}else {
alert(" Bad Search, Check names, first and last.");
}
});}

// ========================= End load.js ==============================================

// ========== Error Message From error console ==========

Timestamp: 09/20/2013 08:46:39 AM
Error: NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN: Cannot modify properties of a WrappedNative
Source File: chrome://global/content/bindings/autocomplete.xml
Line: 915
// ======================== end error message ==========================

// =========== partial document containing line 915 ====
Code:
<?xml version-"1.0"?>


<!DOCTYPE bindings [
<!ENTITY % actionsDTD SYSTEM "chrome://global/locale/actions.dtd">
%actionsDTD;
]>

<bindings id="autocompleteBindings"
          xmlns="http://www.mozilla.org/xbl"
          xmlns:html="http://www.w3.org/1999/xhtml"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
          xmlns:xbl="http://www.mozilla.org/xbl">..
..

<handler event="popuphiding"><![CDATA[
        var isListActive = true;
        if (this.selectedIndex == -1)
          isListActive = false;
        var controller = this.view.QueryInterface(Components.interfaces.nsIAutoCompleteController);
        controller.stopSearch();

        this.mPopupOpen = false;

        // Reset the maxRows property to the cached "normal" value, and reset
        // _normalMaxRows so that we can detect whether it was set by the input
        // when the popupshowing handler runs.
        this.mInput.maxRows = this._normalMaxRows;
        this._normalMaxRows = -1;
        // If the list was being navigated and then closed, make sure
        // we fire accessible focus event back to textbox
        if (isListActive) {
Line 915 =>     this.mInput.mIgnoreFocus = true;
          this.mInput._focus();
          this.mInput.mIgnoreFocus = false;
        }

Last edited by pizzipie; 09-20-2013 at 11:58 AM. Reason: clean up appearance
 
Old 09-21-2013, 11:50 AM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,249

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
Your load.js is physically painful to read. May I suggest paying some attention to issues such as indenting?

Last edited by dugan; 09-21-2013 at 11:51 AM.
 
Old 09-21-2013, 12:55 PM   #3
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Original Poster
Rep: Reputation: 12
Sorry about that, just got in a hurry after long hours of frustration!

R.

Code:
$(document).ready(function() {
			
	$(function() {
		$('#getPartName').one('submit',function() { showValues(); return false; }); //.one is one time only, could be .bind 
	});			

		function showValues() {
			
			var searchName=$('#partnm').val();
			    
			if(typeof(searchName)=="string" & searchName=="") searchName="All Names";	 	
   			
			var str = $("#getPartName").serialize();
			    	
			$(".results-box").fadeIn();

			$(".results").html("Result of Name Search for <span style='color:red;'>" + searchName + "</span> :  Click on Your Choice for Data");

			$(".results").append('<div id="addrsNames"></div>')
			
			.load("makeSelectList.php #addrsNames", str , function() {       
				$("#addrsNames").show(); 
				addSelectChange();
			}); // end load
  
		 } // end showvalues
				
}); // end docready
		
// ======================= function addSelectChange() ========================

function addSelectChange(){ 

   $('select').one('change', function(){ 
   		var mySelection= $("option:selected", this).val();

			if(mySelection) { 
   				window.location.href="ContactInit.html?Display_Name="+ encodeURIComponent(mySelection); 
			}else {
				alert(" Bad Search, Check names, first and last.");	
			} // else 
    		
  	}); // end select

} // end addselect
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any way to keep a remote terminal running even when you quit your client program? roystonlodge Linux - General 2 10-14-2009 03:54 PM
Quit console program Micik Linux - Software 3 03-07-2007 08:30 AM
glibc causes program to quit irisevelyn Linux - Software 9 06-01-2005 01:48 PM
Howto run a program for 15 seconds and let it quit itself. bglnelissen Programming 3 03-16-2005 09:37 AM
quit program after a specific time (prob. BASH) bglnelissen Linux - General 2 01-25-2005 01:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration