How to run a javascipt under another javascript?, I need help! |
![]() ![]() |
How to run a javascipt under another javascript?, I need help! |
![]()
Post
#1
|
|
Newbie ![]() Group: Member Posts: 3 Joined: Aug 2006 Member No: 454,979 ![]() |
Basically, this is my problem
<!-- start code provided by createblog.com --> <script> titleContent = 'Example'; moduleContent = '<script type='text/javascript'>document.write('\u003c\u0073\u0063\u0072\u0069\u0070\u0074\u0020\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065\u003d\u0022\u004a\u0061\u0076\u0061\u0053\u0063\u0072\u0069\u0070\u0074\u0022\u0020\u0073\u0072\u0063\u003d\u0022\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0062\u0069\u0062\u006c\u0065\u0067\u0061\u0074\u0065\u0077\u0061\u0079\u002e\u0063\u006f\u006d\u002f\u0075\u0073\u0061\u0067\u0065\u002f\u0076\u006f\u0074\u0064\u002f\u0076\u006f\u0074\u0064\u0032\u0068\u0074\u006d\u006c\u002e\u0070\u0068\u0070\u003f\u0076\u0065\u0072\u0073\u0069\u006f\u006e\u003d\u0033\u0031\u0026\u0061\u006d\u0070\u003b\u006a\u0073\u0063\u0072\u0069\u0070\u0074\u003d\u0031\u0022\u003e\u0020\u000d\u000a\u003c\u002f\u0073\u0063\u0072\u0069\u0070\u0074\u003e\u000d\u000a\u003c\u0021\u002d\u002d\u0020\u0061\u006c\u0074\u0065\u0072\u006e\u0061\u0074\u0069\u0076\u0065\u0020\u0066\u006f\u0072\u0020\u006e\u006f\u0020\u006a\u0061\u0076\u0061\u0073\u0063\u0072\u0069\u0070\u0074\u0020\u002d\u002d\u003e\u000d\u000a\u003c\u006e\u006f\u0073\u0063\u0072\u0069\u0070\u0074\u003e\u000d\u000a\u003c\u0061\u0020\u0068\u0072\u0065\u0066\u003d\u0022\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0062\u0069\u0062\u006c\u0065\u0067\u0061\u0074\u0065\u0077\u0061\u0079\u002e\u0063\u006f\u006d\u002f\u0075\u0073\u0061\u0067\u0065\u002f\u0076\u006f\u0074\u0064\u002f\u0076\u006f\u0074\u0064\u0032\u0068\u0074\u006d\u006c\u002e\u0070\u0068\u0070\u003f\u0076\u0065\u0072\u0073\u0069\u006f\u006e\u003d\u0033\u0031\u0026\u0061\u006d\u0070\u003b\u006a\u0073\u0063\u0072\u0069\u0070\u0074\u003d\u0030\u0022\u003e\u0056\u0069\u0065\u0077\u0020\u0056\u0065\u0072\u0073\u0065\u0020\u006f\u0066\u0020\u0074\u0068\u0065\u0020\u0044\u0061\u0079\u003c\u002f\u0061\u003e\u0020\u000d\u000a\u003c\u002f\u006e\u006f\u0073\u0063\u0072\u0069\u0070\u0074\u003e');</script>'; sub = subTitle.parentNode.parentNode.parentNode.parentNode.parentNode sub.insertAdjacentHTML('beforeBegin','<table border="1" cellspacing="0" cellpadding="4" width="100%" class="left"><tr><th valign="top" align="left" class="left">' + titleContent + '</th></tr><tr><td valign="top" class="left">' + moduleContent) sub.insertAdjacentHTML('beforeBegin','<BR>'); </script> <!-- end code provided by createblog.com --> ------------------------------------------------------------------ This is the situation. I want to run a encoded javascript in a Extra Left Module(which is another javascript). The two javascripts don't work properly because that the <script> sign of the first javascript(In red) matches the </script> sign of the second javascript (in red). as the result, the </script> sign of the first javascript is left out.(In blue) is there anyway to fix it? As english isn't my mother tongue, it might be a little bit difficult for u guys to understand this complicated situation.However, please try to help me. Cheers. |
|
|
*digital.fragrance* |
![]()
Post
#2
|
Guest ![]() |
Just add a <script> at the beginning of the second javascript code.
You're English is great! |
|
|
![]()
Post
#3
|
|
Newbie ![]() Group: Member Posts: 3 Joined: Aug 2006 Member No: 454,979 ![]() |
Thank you for your kindly reply first of all
i have tried what u have suggested like this: <!-- start code provided by createblog.com --> <script> titleContent = 'Example'; moduleContent = '<script><script type='text/javascript'>document.write('\u003c\u0073\u0063\u0072\u0069\u0070\u0074\u0020\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065\u003d\u0022\u004a\u0061\u0076\u0061\u0053\u0063\u0072\u0069\u0070\u0074\u0022\u0020\u0073\u0072\u0063\u003d\u0022\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0062\u0069\u0062\u006c\u0065\u0067\u0061\u0074\u0065\u0077\u0061\u0079\u002e\u0063\u006f\u006d\u002f\u0075\u0073\u0061\u0067\u0065\u002f\u0076\u006f\u0074\u0064\u002f\u0076\u006f\u0074\u0064\u0032\u0068\u0074\u006d\u006c\u002e\u0070\u0068\u0070\u003f\u0076\u0065\u0072\u0073\u0069\u006f\u006e\u003d\u0033\u0031\u0026\u0061\u006d\u0070\u003b\u006a\u0073\u0063\u0072\u0069\u0070\u0074\u003d\u0031\u0022\u003e\u0020\u000d\u000a\u003c\u002f\u0073\u0063\u0072\u0069\u0070\u0074\u003e\u000d\u000a\u003c\u0021\u002d\u002d\u0020\u0061\u006c\u0074\u0065\u0072\u006e\u0061\u0074\u0069\u0076\u0065\u0020\u0066\u006f\u0072\u0020\u006e\u006f\u0020\u006a\u0061\u0076\u0061\u0073\u0063\u0072\u0069\u0070\u0074\u0020\u002d\u002d\u003e\u000d\u000a\u003c\u006e\u006f\u0073\u0063\u0072\u0069\u0070\u0074\u003e\u000d\u000a\u003c\u0061\u0020\u0068\u0072\u0065\u0066\u003d\u0022\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0062\u0069\u0062\u006c\u0065\u0067\u0061\u0074\u0065\u0077\u0061\u0079\u002e\u0063\u006f\u006d\u002f\u0075\u0073\u0061\u0067\u0065\u002f\u0076\u006f\u0074\u0064\u002f\u0076\u006f\u0074\u0064\u0032\u0068\u0074\u006d\u006c\u002e\u0070\u0068\u0070\u003f\u0076\u0065\u0072\u0073\u0069\u006f\u006e\u003d\u0033\u0031\u0026\u0061\u006d\u0070\u003b\u006a\u0073\u0063\u0072\u0069\u0070\u0074\u003d\u0030\u0022\u003e\u0056\u0069\u0065\u0077\u0020\u0056\u0065\u0072\u0073\u0065\u0020\u006f\u0066\u0020\u0074\u0068\u0065\u0020\u0044\u0061\u0079\u003c\u002f\u0061\u003e\u0020\u000d\u000a\u003c\u002f\u006e\u006f\u0073\u0063\u0072\u0069\u0070\u0074\u003e');</script>'; sub = subTitle.parentNode.parentNode.parentNode.parentNode.parentNode sub.insertAdjacentHTML('beforeBegin','<table border="1" cellspacing="0" cellpadding="4" width="100%" class="left"><tr><th valign="top" align="left" class="left">' + titleContent + '</th></tr><tr><td valign="top" class="left">' + moduleContent) sub.insertAdjacentHTML('beforeBegin','<BR>'); </script> <!-- end code provided by createblog.com --> i have added another <script> in front of the second javascript.(in yellow) isn't it what i have supposed to do? Unfortunately, it is not working still. |
|
|
*digital.fragrance* |
![]()
Post
#4
|
Guest ![]() |
QUOTE <!-- start code provided by createblog.com --> <script> titleContent = 'Example'; moduleContent = '<script type='text/javascript'>document.write('\u003c\u0073\u0063\u0072\u0069\u0070\u0074\u0020\u006c\u0061\u006e\u0067\u0075\u0061\u0067\u0065\u003d\u0022\u004a\u0061\u0076\u0061\u0053\u0063\u0072\u0069\u0070\u0074\u0022\u0020\u0073\u0072\u0063\u003d\u0022\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0062\u0069\u0062\u006c\u0065\u0067\u0061\u0074\u0065\u0077\u0061\u0079\u002e\u0063\u006f\u006d\u002f\u0075\u0073\u0061\u0067\u0065\u002f\u0076\u006f\u0074\u0064\u002f\u0076\u006f\u0074\u0064\u0032\u0068\u0074\u006d\u006c\u002e\u0070\u0068\u0070\u003f\u0076\u0065\u0072\u0073\u0069\u006f\u006e\u003d\u0033\u0031\u0026\u0061\u006d\u0070\u003b\u006a\u0073\u0063\u0072\u0069\u0070\u0074\u003d\u0031\u0022\u003e\u0020\u000d\u000a\u003c\u002f\u0073\u0063\u0072\u0069\u0070\u0074\u003e\u000d\u000a\u003c\u0021\u002d\u002d\u0020\u0061\u006c\u0074\u0065\u0072\u006e\u0061\u0074\u0069\u0076\u0065\u0020\u0066\u006f\u0072\u0020\u006e\u006f\u0020\u006a\u0061\u0076\u0061\u0073\u0063\u0072\u0069\u0070\u0074\u0020\u002d\u002d\u003e\u000d\u000a\u003c\u006e\u006f\u0073\u0063\u0072\u0069\u0070\u0074\u003e\u000d\u000a\u003c\u0061\u0020\u0068\u0072\u0065\u0066\u003d\u0022\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0062\u0069\u0062\u006c\u0065\u0067\u0061\u0074\u0065\u0077\u0061\u0079\u002e\u0063\u006f\u006d\u002f\u0075\u0073\u0061\u0067\u0065\u002f\u0076\u006f\u0074\u0064\u002f\u0076\u006f\u0074\u0064\u0032\u0068\u0074\u006d\u006c\u002e\u0070\u0068\u0070\u003f\u0076\u0065\u0072\u0073\u0069\u006f\u006e\u003d\u0033\u0031\u0026\u0061\u006d\u0070\u003b\u006a\u0073\u0063\u0072\u0069\u0070\u0074\u003d\u0030\u0022\u003e\u0056\u0069\u0065\u0077\u0020\u0056\u0065\u0072\u0073\u0065\u0020\u006f\u0066\u0020\u0074\u0068\u0065\u0020\u0044\u0061\u0079\u003c\u002f\u0061\u003e\u0020\u000d\u000a\u003c\u002f\u006e\u006f\u0073\u0063\u0072\u0069\u0070\u0074\u003e');</script>'; <script type='text/javascript'> sub = subTitle.parentNode.parentNode.parentNode.parentNode.parentNode sub.insertAdjacentHTML('beforeBegin','<table border="1" cellspacing="0" cellpadding="4" width="100%" class="left"><tr><th valign="top" align="left" class="left">' + titleContent + '</th></tr><tr><td valign="top" class="left">' + moduleContent) sub.insertAdjacentHTML('beforeBegin','<BR>'); </script> <!-- end code provided by createblog.com --> Try that - I moved the script you inserted - see the bold words. If that doesn't work, try de-coding it. |
|
|
![]()
Post
#5
|
|
Newbie ![]() Group: Member Posts: 3 Joined: Aug 2006 Member No: 454,979 ![]() |
I tried both just now, they both don't work.
Thank you for ur help really. i have now put the code in my "Interest" column as it seems to be the only alternative for me now. U r a star. |
|
|
![]() ![]() |