472,992 Members | 3,237 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,992 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 13274
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.