Solved

Issue with obfuscated js

Posted on 2013-06-21
38
318 Views
Last Modified: 2013-12-25
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
Comment
Question by:ddantes
  • 18
  • 10
  • 5
  • +1
38 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39267199
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
 

Author Comment

by:ddantes
ID: 39267211
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39267236
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
 

Author Comment

by:ddantes
ID: 39267267
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
 

Author Comment

by:ddantes
ID: 39267349
How do you get the redeclaration error to announce itself?  Using F12 and debugging the pages, IE doesn't report it.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39267361
Firefox Error Console.  Ctl-Shift-J.
0
 

Author Comment

by:ddantes
ID: 39267375
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39267411
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
 

Author Comment

by:ddantes
ID: 39267437
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39267463
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
 

Author Comment

by:ddantes
ID: 39267469
Which page are you visiting, where the error console generates that warning?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39267504
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
 

Author Comment

by:ddantes
ID: 39267522
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39267573
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
 

Author Comment

by:ddantes
ID: 39267580
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39267594
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
 

Author Comment

by:ddantes
ID: 39268283
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39268348
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:ddantes
ID: 39268360
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39268368
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
 

Author Comment

by:ddantes
ID: 39268402
That's entirely understandable.  Thank you for looking it over.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39269820
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
 

Author Comment

by:ddantes
ID: 39269829
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39269831
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
 

Author Comment

by:ddantes
ID: 39269840
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39269848
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
 

Author Comment

by:ddantes
ID: 39269850
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39269876
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
 

Author Comment

by:ddantes
ID: 39269881
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
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39269906
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
 

Author Comment

by:ddantes
ID: 39269910
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39271145
I am sorry - the whole code is write once.

What exactly was the problem with the framed version on iOS?
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39271279
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
 

Author Comment

by:ddantes
ID: 39272353
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
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 39272445
Perhaps this will help

http://adactio.com/journal/4470/
0
 

Author Closing Comment

by:ddantes
ID: 39272494
Thanks to both experts.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now