Help. How to strip <script> from Javascript

General questions pertaining to how certain issues can be resolved. This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.
Forum rules
This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.

1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"
Locked
kurdi
Posts: 38
Joined: 03 Mar 2010, 14:01

Help. How to strip <script> from Javascript

Post by kurdi » 07 Aug 2010, 13:29

This is driving me crazy.
I want to add the following Javascript in the header
<script type="text/javascript" src="ImageFlowSource/imageflow.js"></script>

except Suffusion requires that you strip the <script></script> tags (in blog features > custom includes)
(Why oh why is this the case anyway?)
and I cannot seem to remove them and get the code to work. I tried numerous variations.

Please help, thanks.
mys site: www.freewaregenius.com

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Help. How to strip <script> from Javascript

Post by sayontan » 07 Aug 2010, 14:03

Not sure what you are trying to say. All you need to do is to put in the entire path to the imageflow.js file in Blog Features -> Custom Includes -> First External JavaScript file. That's all.

kurdi
Posts: 38
Joined: 03 Mar 2010, 14:01

Re: Help. How to strip <script> from Javascript

Post by kurdi » 07 Aug 2010, 16:01

@ Sayontan: that, I already did. However, I need to add that bit of code into the header. How do I do that.

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Help. How to strip <script> from Javascript

Post by sayontan » 07 Aug 2010, 17:14

If you have done that you don't need to add anything else. The code automatically adds what you want to put

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Help. How to strip <script> from Javascript

Post by sayontan » 07 Aug 2010, 18:18

Can you paste a screenshot of your Custom Includes page? I want to see your JS settings.

kurdi
Posts: 38
Joined: 03 Mar 2010, 14:01

Re: Help. How to strip <script> from Javascript

Post by kurdi » 08 Aug 2010, 11:43

Sayontan: what I am trying to do is insert into the sidebar an image carousel that someone coded for me, and having a very hard time at it.
I started this thread simply because I needed to insert some code into the header, and wished that I didn't need to strip the <script> tag because the tag had the code in it that I didn't know what to do in that situation (I am a non coder)
This is what I mean: <script type="text/javascript" src="ImageFlowSource/imageflow.js">

But you know what, I think there might be something wrong in the code or CSS that they provided, because it was messing up the site's look and feel.

I have now gone back to the coder for a fix. Thanks for your input.

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Help. How to strip <script> from Javascript

Post by sayontan » 08 Aug 2010, 16:44

I started this thread simply because I needed to insert some code into the header, and wished that I didn't need to strip the <script> tag because the tag had the code in it that I didn't know what to do in that situation (I am a non coder)
This is what I mean: <script type="text/javascript" src="ImageFlowSource/imageflow.js">
As I mentioned, this is really easy. Let's say you wanted to insert this: <script type="text/javascript" src="http://www.freewaregenius.com/wp-conten ... ageflow.js"> (note the full path of the file). All you would need to do was to put http://www.freewaregenius.com/wp-conten ... ageflow.js in the location of the first JS file include option, not in the custom JS code option. That's all - Suffusion would take care of writing the script tags out by itself.

Liquid
Posts: 2
Joined: 10 Mar 2013, 03:06

Re: Help. How to strip <script> from Javascript

Post by Liquid » 10 Mar 2013, 04:20

Hi everyone. I have a similar problem with my site. I think it's an easy fix but I just need to be pointed in the right direction.

I am in the process of adding a banner to my site. But it requires me to integrate two different scripts. Here are the specific instructions given to me by the banner agency (between the dotted lines below)
----------------------------------------------------

This page contains all the information you need to show banners on your website. Please follow the instructions carefully and ensure that you copied the scripts exactly as shown below.
Header Script:
Insert the following script at the top of every page on the http://www.freedomthirtyfiveblog.com website. This code goes between the <head> and </head> tags, before any other banner scripts on the page:
<!-- Generated by OpenX 2.8.7 -->
<script type='text/javascript' src='http://www.example.com/delivery/spcjs.p ... '></script>

Banner Script:
Copy the following script and place it in the site where you want the banner to display:
<script type='text/javascript'><!--// <![CDATA[
/* [id80] http://www.freedomthirtyfiveblog.com - 300X250 */
OA_show(80);
// ]]> --></script><noscript><a target='_blank' href='http://www.example.com/delivery/ck.php?n=y26dj71'><img border='0' alt='' src='http://www.example.com/delivery/avw.php ... &n=y26dj71' /></a></noscript>

-------------------------------------------------------

I have tried using "custom includes" by typing "http://www.example.com/delivery/spcjs.php?id=85" without the quotes into the First External JavaScript file space like sayontan mentioned. Then I copy/pasted the entire contents of the Banner Script into a "text" widget on the side bar. But it doesn't seem to be working. The banner doesn't show up and the widget is a compressed line because there's nothing in it. Any suggestions would be appreciated.

Thanks, and great theme by the way :D

ps. I should also point out that I was given a banner code but I'm not sure what I should do with it. The code is below in case it has important information.

<script type='text/javascript'><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://www.example.com/delivery/ajs.ph ... ry/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=80");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://www.example.com/delivery/ck.php? ... UMBER_HERE' target='_blank'><img src='http://www.example.com/delivery/avw.php ... &n=y26dj71' border='0' alt='' /></a></noscript>

Locked