var delay = 2000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to
....
fcontent[0]="<span class='tickerText'>I WANT TO PUT JAVASCRIPT IN HERE for example <script src="http://www.somedomain.com/somescript.js"</span>";
You don't need to split the script tag up into sections, you just need to escape the / as \/ so that the browser doesn't read <\/script> as the end of the current script.
Hi.
You can not create a script inside a script.
BUT
you can merege both files (*.js) into a single file.
OR
you can call one script from another by calling it's function.
OR
you can create a "child" script tag in the body but it does not always work well...
have tried the first solution but could not get it to work, I liked the suggestion of combining the javascript only problem is I have no control over the script I am calling in because I get it from an external source. So I cant use the function only the src tag is available to me.
so lets say I have my .js file i have function:
// function call external
function callExternal() {
<script src="http://link_from_external site"></script>
}
function scrollingText() {
ticker.text[0] = callExternal1();
}
does this clarify my problem?
// end function
I have used flash with the xml feed to get around the problem but would still like to understand how to get around this.
Hi.
If the script is from another site, not for RSS feed, you can very easy DOWNLOAD the file by typing in the full URL in the address line and save it and upload it to your site.
If it is for RSS feed, it can still be done but must be checked first.
[part2] - outputs html
<tr>
<td style="font-size:1px;"><!--CashSplash--><SCRIPT src="http://www.somedomain.com/getFile.php?progid=1&id=644&pw=644&cbox=0&showlogo=no"></SCRIPT></td>
</tr>
I see what you meant by typing in the url of the mandatory script I see the function but by downloading it and putting it in the function I will lose the updating? meaning its a script that continuosly update values.
I guess I could write a html / xml / javascript function that retrieves the xml and then write it to an array and then use it with my ticker? Is that the correct way?
I need to understand one thing, is this javascript given to you from the service or is it an include script you were provided for this service to work. Then We can go from there.
Hi.
If they give you link to the XML file, I can give a PHP code to read and use it.
I prefer PHP over javascript when possible.
But I don't really see what is the problem in running the first script, and then running the second calling the function from the first?
The only thing/s you MUST know is the variables names so that you can retrive them and use them in the other script.
What I have come across is that you include some javascipt on your site which creates an instance of the news website info on your page. It is probably not and xml feed such as rss because if you have images or text to format it would be dificult to get this done on a browser standard way so to speek. If there is indeed some javascript in the feed you are wise to put the local code that interacts with the news elements at the bottom of the page so that to make sure the timing of the news and the page load is correct so you do not get error from elements or functions not being loaded in the browser on time. Hope that makes sense.
Hi
So one script is from Dynamic Drive running from YOUR web site (I guess), and the other runing from another EXTERNAL web site?
What is the connection between them both? how do the interact?
the connection between the two is that I am using the ticker script from dynamic drive and the content of each individual ticker is a seperate javascript which I receive as <script language="javascript" src="http://www.domain.co.za/feed.php?id=1"></script>
just to explain what the remote javascript does, its an online moblie gambling jackpot updater. So it updates the html on real time showing the value of the jackpots.
also I can not use php since the website is going to be hosted on a IIS server, probably running as ASP.NET.
I have already made this thing work using flash and the xml feed, because of all the complexity involved with combining javascript but was just curious on how to combine javascript inside javascript.
I do agree that putting the functions of the source (external javascript) would be a much smarter idea but would that still work since the javascript pulls values from another website (jackpot values) and updates it.
but all that is showing in the header is follow@twitter as a hyperlink, and the twitter BUTTON is not rendering. How should I input the javascript code inside the header.js ?
Bookmarks