Results 1 to 3 of 3

Thread: obfuscate document.write

  1. #1
    Join Date
    Feb 2014

    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:
    <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);
    This works great. Now the problem is actually calling the script. THis is the code I'm using:

    var url = 'http://hosting.kyozou.com/jomar/images/nav.js'
    document.write('<script src="'+url+'"></scr'+'ipt>')
    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.

  2. #2
    Join Date
    Dec 2005
    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/javatut...criptcss.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.

  3. #3
    Join Date
    Dec 2002
    Calgary, Canada
    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.


    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center