473,395 Members | 1,931 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

subroutine interfering; causing functions in .js file to fail.

Claus Mygind
571 512MB
I have a number of common routines stored in one .js file which I load with all my apps. I was making changes to one of the functions in this file. And it works great for the apps that use this function. However another app which does not even call this function causes any function call located in this file to fail. The error message I get is "... is not defined". where ... is any function in the .js file.

Using Firebug, I can see that the .js file has been loaded, so I was just wondering how this can happen? And what can I do to resolve the problem.? Here is the code:

Expand|Select|Wrap|Line Numbers
  1. function StartSmallSearchResult(cWhichClient, cIsJob) {
  2.  
  3.     if (cIsJob)
  4.     {
  5. /*
  6. when this condition is commented out then there is no problem.
  7. The cIsJob is a parameter that may or may not be passed. I have two apps. where it is passed and one app. where it is not, where everything works fine.
  8. In these 3 apps. this function is called.
  9.  
  10. I have a 4th app. where this function is not called, but the "if (cIsJob)" condition causes other function calls to fail.
  11.  
  12. I have also tried
  13. if (cIsJob == true), but that does not work either.
  14.  
  15. I can leave the results of the if condition in the function and that is not a problem.  It is only the if condition that creates the problem.
  16. */
  17.         var cJobOrGeoTech = true;
  18.     }else
  19.         var cJobOrGeoTech = false;
  20.     }
  21.     if (cWhichClient=="ComContact")                              
  22.     {                                                     
  23.         var cId = f1.COMID.value; 
  24.     }else{                              
  25.         var cId = f1.ID.value;      
  26.     }
  27.     var cWidth  = 450;       
  28.     var cHeight = screen.availHeight;     
  29.     CenterWindow( cHeight, cWidth);
  30.     smallSearchWindow =window.open('SmallSearchResult.exe?SEARCH='+cId+'&FieldName='+cWhichClient+'&isJobOrGeoTech='+cJobOrGeoTech+'&SearchId=yes&SETMODE=No',
  31.         'SmallsearchWindow',
  32.         windowFeatures);
  33.  
  34.     smallSearchWindow.focus(); 
  35.     return false;               
  36. }
  37.  
Aug 18 '08 #1
1 1070
Claus Mygind
571 512MB
Just as I posted this, I found the error. A missing { in the "}else". So no help is needed. Just frustrated it took me 1hr. to spot the missing {

Odd how the problem did not appear in the apps that actually used this function.
Aug 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: August1 | last post by:
A handful of articles have been posted requesting information on how to use these functions in addition to the time() function as the seed to generate unique groups (sets) of numbers - each group...
0
by: Chris Newby | last post by:
I have a custom control that is essentially implemented as follows: ================================================ public class TestPanel : WebControl, INamingContainer { protected override...
4
by: otterbyte | last post by:
Hi, I have a bit of code which is confusing me to no end. Here are the basics: 1) The class module is being used in the module of a form. 2) There is an instance of the object declared at the...
3
by: sangith | last post by:
Hi, I have question on processing the file handle in a subroutine. Here is my program without subroutine: open FH1, "<outfile" or die "cannot open the file for reading: $!\n"; while...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.