473,421 Members | 1,562 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,421 software developers and data experts.

How to get the correct js content?

7 Nibble
when I check this link:
[Z{Link redacted by moderation}]

I get bellow messy code:



how to get the correct format js content?
May 16 '22 #1

✓ answered by sjain6

Hi,

I had an equivalent Java issue, so I tackle it along these lines:

The js record contains something like
window.someVarForReturn = 'content for return'
On html
Expand|Select|Wrap|Line Numbers
  1. <script src="file.js"></script>
  2. <script>console.log(someVarForReturn)</script>
For my situation the substance was html layout. So I followed through with something like this:

On js record
window.someVarForReturn = '<did>My template</div>'
On html
Expand|Select|Wrap|Line Numbers
  1. <script src="file.js"></script>
  2. <script>
  3. new DOMParser().parseFromString(someVarForReturn, 'text/html').body.children[0]
  4. </script>
  5.  
Regards -

2 13626
zmbd
5,501 Expert Mod 4TB
Hello markleo,

1) What you have appears to be a binary file - many stand-alone Hex-Editors that would let you see a more human readable format.
Either this isn't the JS file you were trying to obtain, the author has used a minifier - I'm not familiar enough those to be able to advise you, or you have stumbled upon something nefarious - no way to really tell from our end.

2) I could not verify the safety of the link you posted so I had to redact it from your post; however, I would advise you to contact the website owner to see if you can obtain the actual JS-File.

3) Externally linked image files are not always visible to many of our experts - you might want to edit your message by using the advanced editor to upload the image to your post and then embed the image.
May 16 '22 #2
sjain6
2
Hi,

I had an equivalent Java issue, so I tackle it along these lines:

The js record contains something like
window.someVarForReturn = 'content for return'
On html
Expand|Select|Wrap|Line Numbers
  1. <script src="file.js"></script>
  2. <script>console.log(someVarForReturn)</script>
For my situation the substance was html layout. So I followed through with something like this:

On js record
window.someVarForReturn = '<did>My template</div>'
On html
Expand|Select|Wrap|Line Numbers
  1. <script src="file.js"></script>
  2. <script>
  3. new DOMParser().parseFromString(someVarForReturn, 'text/html').body.children[0]
  4. </script>
  5.  
Regards -
Jun 17 '22 #3

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

Similar topics

8
by: Stromboli | last post by:
Hi, I have my site available in a couple of languages most of the files are indexf.html (french), indexi.html (italian) and indexde.html (german).. I'd like to start using multiviews but I've...
22
by: Trevor Orton | last post by:
Hello, I'm having a slight problem using the W3C html validator and I've reviewed the FAQ's with no luck so hopefully someone here would be kind enough to point me in the right direction. I...
0
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
1
by: Anthony Planz | last post by:
Hello, I have a problem with displaying Greek fonts in a content placeholder. The Masterpage content displays correct, the content inside the content placeholder not. Example:...
1
by: redgoals | last post by:
Hi All, I will be creating a white label website for car hire dealers. My main website will be called something like: carhire.com, the content on carhire.com will be pulled in from a database. ...
1
by: iorchSG | last post by:
Hi, I’m migrating an application from HP-UX to Solaris Apache 1.3.27 HP-UX B.11.11 U 9000/800 Solaris SunOS 5.10 Generic_147440-10 sun4u sparc SUNW,SPARC-Enterprise In solaris, my whole...
5
by: kcbehnet | last post by:
I am using a navigation form with top navigation control named as "NavigationControTop" and left navigation control named as "NavigationControLeft". The subform where the main content is displayed is...
0
by: dseals22 | last post by:
How can I get my current content to slide to the left and bring in new content from the right (after clicking on button 1) when an existing student's username and password are correct, and if it's...
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.