Link to home
Start Free TrialLog in
Avatar of ddantes
ddantesFlag for United States of America

asked on

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
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

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.
Avatar of ddantes

ASKER

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.
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.
Avatar of ddantes

ASKER

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.
Avatar of ddantes

ASKER

How do you get the redeclaration error to announce itself?  Using F12 and debugging the pages, IE doesn't report it.
Firefox Error Console.  Ctl-Shift-J.
Avatar of ddantes

ASKER

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?
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.
Avatar of ddantes

ASKER

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?
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()
Avatar of ddantes

ASKER

Which page are you visiting, where the error console generates that warning?
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.
Avatar of ddantes

ASKER

On both pages, I got no errors and 3 warnings.  Screenshot attached.  User generated imageMy 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.
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?
Avatar of ddantes

ASKER

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.
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.
Avatar of ddantes

ASKER

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.
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?
Avatar of ddantes

ASKER

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.
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.
Avatar of ddantes

ASKER

That's entirely understandable.  Thank you for looking it over.
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.
Avatar of ddantes

ASKER

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.
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
Avatar of ddantes

ASKER

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."
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
Avatar of ddantes

ASKER

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.
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.
Avatar of ddantes

ASKER

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.
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.
Avatar of ddantes

ASKER

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.
I am sorry - the whole code is write once.

What exactly was the problem with the framed version on iOS?
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
Avatar of ddantes

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ddantes

ASKER

Thanks to both experts.