|
Post by coldstone on Feb 13, 2008 19:11:18 GMT -5
You would have to escape those amphersands (&&) to get them to work with Greymatter anyway. It used to use them internally and so it automatically changes them to |AMP| whenever it gets a chance.
If you get a chance to try that and see if it works. I am kinda curious.
So, do you not use your javascript menu anymore then? Otherwise, you could probably do the js include in the head and hide the script in a seperate file (it would be outside of Gm, but it would probably work).
|
|
|
Post by bullergotya on Feb 14, 2008 5:01:24 GMT -5
"You would have to escape those amphersands (&&)" not sure what you mean? I did noticed that it would change it to |AMP| , what would I code it to, then I can try it? I have tried to setup that code in a js file, but keep failing, do not really know how to setup the code in the js file and not sure what code to use to call it from the template. Not a programer just do the site as a hobby.
|
|
|
Post by coldstone on Feb 14, 2008 18:22:40 GMT -5
That might be an old bug I am remembering, but previously, you had to have the '&&' or even a '&' as a |AMP| in the templates. So whereever you see a '&' change it, and with the '&&' it would be '|AMP||AMP|'. As far as including it in another file, search google for 'external javascript', here is one of the first hits I got: www.javascripter.net/faq/externa2.htmIts just putting all your javascript in a file like 'foo.js' and then linking to it from your source page. It makes the html cleaner and its easier to reuse the javascript, plus makes your web pages smaller since the browser will cache the external javascript file, like the external css file.
|
|
|
Post by bullergotya on Feb 14, 2008 21:24:30 GMT -5
I tried the '&&' did not work, I could save the template but the menu did not show. The external .js file, the only hard problem to solve is that, the line of code is actually calling to 3 javascript files, the main one, one for IE and one for NS and the main js, the code does not call for the other files, his code I posted here is just telling the browser to pick the right js depending on what browser it is, I believe. So do I combine all the codes in one js file or do I place calls for all three <SCRIPT LANGUAGE="JavaScript" SRC="myscript1.js" SRC="myscriptIE.js" SRC="myscriptNS.js"> </SCRIPT> have to try both of those and see what happens.
|
|
|
Post by coldstone on Feb 15, 2008 15:27:11 GMT -5
Hmm, interesting I am not sure. I think you could put them all into one file, but otherwise, you would need a Script tag for each source file, you wouldn't be able to do the example you gave.
|
|
|
Post by bullergotya on Feb 15, 2008 17:16:01 GMT -5
Sweet finally got it to work. Copied the main js code to a new js file, at the end of that code i put the: (var HOPBn=false;uagent = window.navigator.userAgent.toLowerCase();HOPBn=(uagent.indexOf('opera') != -1)?true:false;var IEC=false;var scompat = document.compatMode;if(scompat != "BackCompat"){IEC=true;}else{IEC=false;}if((document.all)&&(HOPBn==false)&&(IEC==false)){document.write('<div id="tmp1hmplcmenu1" style="position:relative;width:622px;height:24px;background:#AEDFFF;padding:0px;overflow:hidden;border-width:0px;"></div >'); document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenutmp1ie.js\"></scr"+"ipt>");}else{ document.write("<scr"+"ipt language=\"javascript\" sr"+"c=\"sfmenutmp1ns.js\"></scr"+"ipt>");}) the original code but only the code starting at the VAR and it worked. cool beans mikescomputerinfo.com/archives/file/?
|
|
|
Post by coldstone on Feb 19, 2008 18:45:31 GMT -5
Glad to hear
|
|