/    Sign up×
Community /Pin to ProfileBookmark

obfuscate document.write

I am in no way fluent in JavaScript, so I apologize in advance if my question is elementary.

What I’m trying to do is add a megamenu to an ebay store. Unfortunately, there is a 10KB limit for the HTML, and the smallest I can make my HTML is 12KB. So, I moved the menu to an external file and am trying to load the external file using javascript. After perusing the ebay community help forum, I am very close to getting this to work, I’m just running into 1 snag.

Ok, to use javascript in an ebay head it has to be obfuscated. I am able to call the jquery library like this:

[CODE]<script async type=”text/javascript”>
var az = “SC”;var bz = “RI”;var cz = “PT”;var dz = “SR”;var ez = “C=”;var fz = “htt”;var gz = “p://”;
/* jQuery – Now Add in jQuery */
var hz = “.com”;
var jz = “ajax.googleapis”+hz+”/”;
var resource = document.createElement(“script”);
resource.src = fz+gz+jz+”ajax/libs/jquery/1.10.2/jquery.min.js”;
var script = document.getElementsByTagName(“script”)[0];
script.parentNode.insertBefore(resource, script);
</script>[/CODE]

This works great. Now the problem is actually calling the script. THis is the code I’m using:

[CODE]<script>
var url = ‘http://hosting.kyozou.com/jomar/images/nav.js’
document.write(‘<script src=”‘+url+'”></scr’+’ipt>’)
</script>[/CODE]

I’ve tried to rewrite this into more pieces (like the above), but as I have no clue what I’m doing I can’t seem to get it to work. Any suggestions would be greatly appreciated.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERFeb 25.2014 — I don't believe you can use document.write AFTER the page has been rendered as a display.

Doing so causes the browser to reload the page to the original display without the contents you are trying to add.

I have trying using ebay, but you might want to look at this: http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml

Looks like a way to load the external JS file without using the document.write function.

Only a suggestion as I have not tried it with your problem.
Copy linkTweet thisAlerts:
@Khalid_AliFeb 25.2014 — trying hide something which is inherently in public domain is a strange desire. So don't waste your time as you will not be able to hide web content.
×

Success!

Help @webdesigner28 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...