Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:

Issue with obfuscated js

My website uses an online reservation system based on a frameset, using cgi and perl to populate a parent frame with child windows.  This is causing a scaling issue for touchscreen visitors, especially iPhone, and an expert recommended that I re-implement this system without the frameset.  Some progress has been made.  One remaining issue is the failure of the non-frameset version to populate a table with tentative reservation data.  I believe the function is termed "showBookingList".  

The frameset version (which displays the table) is at http://mauitradewinds.com/RezEasy/rezeasy.html    To observe the table, which is the subject of this question, click "New Booking", change the date to June 1, 2014, and click "Continue".  A page will load, with a form for entering contact details.  Below that form is a table, showing the tentative booking.

The non-frameset version (which is missing the table) is at
http://mauitradewinds.com/RezTest/rezeasy-bf.html   To observe the missing table, change the date to June 1, 2014 and click "continue".  The page for contact details loads, but the tentative reservation details have not populated the "skeleton" of a table below it.

The main changes between the two versions are removal of references to "MainFrame" and "parent" in the program file, and the transformation of former child windows into stand-alone, ordinary html pages by replacing the frameset with a div.

I think the main obstacle to resolving this is the obfuscation of the program file, which was apparently done by the software vendor to discourage modification.  The frameset version can be downloaded from http://mauitradewinds.com/RezEasy/Program/rsv50std.js  and the non-frameset version from http://mauitradewinds.com/RezTest/Program/rsv50std.js
0
ddantes
Asked:
ddantes
  • 18
  • 10
  • 5
  • +1
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
It's not 'obfuscated', it just uses hard to distinguish variable names.  That should have No effect on the execution of the program.  Computers don't have problems with names like that, only people do.
0
 
ddantesAuthor Commented:
Thank you.  My statement about "obfuscation" being an obstacle to resolving the issue wasn't to suggest that it is causing the issue.  It is making it difficult to resolve the issue, because consultants don't know what part of the js file to edit, in order to populate the booking list.  Sorry for not clarifying that in the original posting.
0
 
Dave BaldwinFixer of ProblemsCommented:
You might try getting rid of 'noscript.js' because it looks like it is not working.  You're getting a 'redeclaration' error on both pages.

Check to see if you have changed the 'name's or 'id's of any of the form elements.  That would stop the javascript from working properly.  The non-frame page does not show today's date when you bring it up but the old frames page does.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
ddantesAuthor Commented:
Thank you.  I have compared the two js files, and the differences I see are:
1. "MainFrame."   is removed from the non-frameset version;
2. "parent."    is removed from the non-frameset version;
3. Around line 320, "MainFrame.location.href = faXXTnNHtnOxKf;"  in the frameset version has been replaced with  "document.forms.Availability.submit();"  in the non-frameset version.

I don't see a difference in the name or id of form elements.

I'll look into the noscript.js issue, but I don't think that's the problem, since it applies to both versions.
0
 
ddantesAuthor Commented:
How do you get the redeclaration error to announce itself?  Using F12 and debugging the pages, IE doesn't report it.
0
 
Dave BaldwinFixer of ProblemsCommented:
Firefox Error Console.  Ctl-Shift-J.
0
 
ddantesAuthor Commented:
My Firefox installation has problems with the error console.  I haven't used it before.  It's reporting errors at certain line numbers, and the specific item which is reported as an error doesn't exist at that line number, or anywhere else in the file.  Not only that, but most of the same errors and warnings also appear in the console if I open a blank page.

That aside, have you any further insight about how to populate the booking list in the non-frameset version?
0
 
Dave BaldwinFixer of ProblemsCommented:
The Error Console is a running list like a log of the recent errors.  When you want to look at the errors on a specific page, you need to open the Error Console and clear the previous info before you go to the new page.  Or go to the page, clear it, and then refresh the page.
0
 
ddantesAuthor Commented:
That helped. I'm getting only three warnings now, all of them associated with stylesheet references or properties, such as border radius.  But nothing about noscript.js

Anyhow, any suggestion about the main question?
0
 
Dave BaldwinFixer of ProblemsCommented:
No.  Here's the warning message.

Timestamp: 6/21/2013 6:46:12 PM
Warning: TypeError: redeclaration of var noscript
Source File: http://mauitradewinds.com/js/noscript.js
Line: 18, Column: 9
Source Code:
function noscript()
0
 
ddantesAuthor Commented:
Which page are you visiting, where the error console generates that warning?
0
 
Dave BaldwinFixer of ProblemsCommented:
Both http://mauitradewinds.com/RezEasy/rezeasy.html and http://mauitradewinds.com/RezTest/rezeasy-bf.html  Firefox, Ctl-Shift-J, go to Tools -> Web Developer -> Error Console.
0
 
ddantesAuthor Commented:
On both pages, I got no errors and 3 warnings.  Screenshot attached.  error consoleMy main concern is not with noscript.js, but with populating a table with booking data.  Still, I don't understand why our Firefox consoles produce different reports.
0
 
Dave BaldwinFixer of ProblemsCommented:
I am using the latest version of Firefox, version 21.0.  I also have the 'All' button clicked, not just the Warnings.  Do you have Firebug and Web Developer installed?
0
 
ddantesAuthor Commented:
I doubt that I have any special add-ons installed, because I seldom use Firefox.  I'll check in the morning when I'm back in the office.  The error console did show tabs for errors, warnings and messages, so I think the "all" button must be clicked.  I'll post again later, and thank you.
0
 
Dave BaldwinFixer of ProblemsCommented:
I recommend Firefox and the Firebug and Web Developer add-ons.  They can tell you more about what is happening on your page than anything else I know of.  About the only reason I use IE anymore is to answer questions here.
0
 
ddantesAuthor Commented:
I updated to Firefox 21 and installed the Firebug and Web Developer add-ons.  I made sure the "All" button is clicked on the error console, cleared the console, and refreshed the page.  The same three warnings appear, and nothing further, at http://mauitradewinds.com/RezEasy/rezeasy.html  and
http://mauitradewinds.com/RezTest/rezeasy-bf.html 
 
However, I think this matter is tangential to the task which I'm hoping to accomplish, relating to populating a table with booking data.
0
 
Dave BaldwinFixer of ProblemsCommented:
If it was killing your other javascript, it would not be.  I also get a dozen warnings about Google Analytics code and 3 about your Pro Tracker Code.

What do the Hallisoft people say about your problem?
0
 
ddantesAuthor Commented:
Hallisoft no longer supports the version which I am using, which is around ten years old.  However, extensive customization was performed on our version, by them, so that it works with our rate structure.  Their later releases still use a frameset, and would require even more custom work, because they use a different approach to long-stay discounts.  In December, they plan to release a version which does not use a frameset, and I'm looking forward to seeing it.
0
 
Dave BaldwinFixer of ProblemsCommented:
Then you are stuck with editing their javascript to make it work.  That's more work than I am willing to do.  I suggest you click on "Request Attention" above and see if someone else can help you more.
0
 
ddantesAuthor Commented:
That's entirely understandable.  Thank you for looking it over.
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I took a quick look at your site and there are a couple of errors I saw that breaks the reservation system.  If it's that old, I would start over.  

To answer your question the non frame version is using your test data.  Make sure your test data is good and uses the date info you are testing with.
0
 
ddantesAuthor Commented:
Thank you for having a look.  I'm not sure which errors you noticed, but the version with frameset is working.  It's the non-frameset version which is problematic.  Can you specify where and what these errors are?

As far as starting over, that's a little difficult.  I haven't found another commercially-available online reservation system which can be hosted on my own server, and which can accommodate our rate and discount structure.  I've tested dozens of them.

You mentioned that the non-frameset version is using test data.  Can you educate me about this?  I expected that it was using whatever data a user entered into the forms.
0
 
Michel PlungjanIT ExpertCommented:
You need to find where
ZXpadsqfxD
is populated.

I cannot find it anywhere - I guess it used to be set - perhaps by the missing frameset
0
 
ddantesAuthor Commented:
Thank you.  I find numerous references to that variable in rsv50std.js   but I'm not sure what is meant by "where it is populated."
0
 
Michel PlungjanIT ExpertCommented:
It is initialised to empty

Then later the table is populated with its content.

I am missing where that content is created or passed


PS: Bedtime here
0
 
ddantesAuthor Commented:
Thank you, and have a good sleep.  It's late morning in Hawaii.   I'm hoping you can continue this dialog tomorrow.

That variable is referenced in cgi-bin/rsv50vcr.pl, which I'll attach as a text file.rsv50vcr.txt

I tried replacing "parent." with nothing in that file, similar to what has been done with the program file and other pages, but it didn't result in populating the booking list.

Also, in the program file rsv50std.js, starting around line 2339, there seems to be code for inserting values into that variable.
0
 
Michel PlungjanIT ExpertCommented:
window.opener.parent.ZXpadsqfxD

is then from another page that used to open a popup - possibly the iframe popping the window and the array stored in the main window.

I see an eval. I think that is the one that we need to look at.
0
 
ddantesAuthor Commented:
Thank you.  I don't want to keep you up longer.  That variable only appears in the program file and the pl.   Hope to hear from you tomorrow.
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If you are just trying to make it work without the frameset,  just replace the test js with the live js.  Like I said, it probably  has something to do with missing data.

The errors are in the Availability link.  Click on the Display Calendar on the left.
0
 
ddantesAuthor Commented:
Thank you.  Sorry for my lack of comprehension, but could you explain what is meant by replacing test js with live js?

On the availability link, when I click "Display Calendar" I see a calendar with dates marked available or unavailable, appropriately.  So I'm not clear on the error.
0
 
Michel PlungjanIT ExpertCommented:
I am sorry - the whole code is write once.

What exactly was the problem with the framed version on iOS?
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Look for files that reference RezTest instead of RezEasy.  The non framed version looks like it is referencing testdata as also included is a file for testdata.

mauitradewinds.com/RezEasy/Program/rsv50std.js
mauitradewinds.com/RezTest/Program/rsv50std.js
0
 
ddantesAuthor Commented:
Thank you both for your comments.
mplungjan:  When iPhone users try to make a reservation, they must zoom in to a frameset child page in order to perform tasks, then tap a link to continue to the next window.  The next window opens zoomed, not at scale=1, because the scaling is carried forward by the frameset parent.  The visitor may not even recognize that a new window has loaded, because there are similarities among the child pages, and that causes confusion.  In the interim, I've made a popup which alerts the visitor to this, under some conditions.  But I  haven't found a way to reset the frameset parent to scale=1 when the frameset content is changed, i.e., a new child window opens.  So I tried to re-implement the program without frameset.

padas:  RezTest is the folder which contains my work-in-progress on a non-frameset version of RezEasy.  That folder uses actual data, not test data.   The RezEasy and RezTest programs do make reference to test data, but that something which the software vendor created,in relation to the initial deployment of the system, and not related to the present situation.
0
 
Michel PlungjanIT ExpertCommented:
Perhaps this will help

http://adactio.com/journal/4470/
0
 
ddantesAuthor Commented:
Thanks to both experts.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 18
  • 10
  • 5
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now