JavaScript - How Do I Add A Link In This Menu , Code Included + Demo
Hi I'm pretty new to javascript.. infact very new, only 4 days old , and I'm like this -->
Anyway, I want to add a link in this menu . I want the link to be where the text " Go to the front page, Want to know more about us?, Keep in touch with us, call any time you want " How do I do that? cheers! here's the page : http://www.mts-photo.com/fotter_nav.html Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Jquery Tutorial : Horizontal animated menu</title> <link type="text/css" href="css/menu.css" rel="stylesheet" media="screen" /> <script type="text/javascript" src="inc/jquery.js"></script> <script type="text/javascript" src="inc/menu.js"></script> </head> <body> <div id="wrapper"> <ul id="menu"> <li><a href="test.html" title="Go to the front page", >Home</a> </li> <li><a href="#" title="Want to know more about us?">About Us</a></li> <li><a href="#" title="Keep in touch with us, call any time you want">Contact Us</a></li> <li><a href="#" title="Ny link">Nylink 1</a></li> </ul> </div> </body> </html> Similar TutorialsHi, I have the below javascript that insert smiles for me. But in Firefox, it is inserting at the bottom of the message Edit: This only happens when there in no text input first before the smile. For exmple Quote: -- Original Message --- test send :-) -- End Original Message --- ;-) I would like it be inserted, like Quote: ;-) -- Original Message --- test send :-) -- End Original Message --- Note: ;-) would be the smile It works fine in Internet Explorer, but Firefox, put it in the wrong place, can anyone help. The javascript code I use is below: Code: //Smile Start var myAgent = navigator.userAgent.toLowerCase(); var myVersion = parseInt(navigator.appVersion); var is_ie = ((myAgent.indexOf("msie") != -1) && (myAgent.indexOf("opera") == -1)); var is_nav = ((myAgent.indexOf('mozilla')!=-1) && (myAgent.indexOf('spoofer')==-1) && (myAgent.indexOf('compatible') == -1) && (myAgent.indexOf('opera')==-1) && (myAgent.indexOf('webtv') ==-1) && (myAgent.indexOf('hotjava')==-1)); var is_win = ((myAgent.indexOf("win")!=-1) || (myAgent.indexOf("16bit")!=-1)); var is_mac = (myAgent.indexOf("mac")!=-1); function smile( txt ) { // document.all.txtmessage.value = document.all.txtmessage.value + txt; // return false; doInsert(" " + txt + " ", "", false,document.getElementById('txtmessage')); } function smile2( txt ) { doInsert(" " + txt + " ", "", false,document.getElementById('txttemplate')); } function smile3( txt ) { doInsert(" " + txt + " ", "", false,document.getElementById('txtcomments')); } function doInsert(ibTag, ibClsTag, isSingle, name_txt) { var isClose = false; var obj_ta = name_txt; //---------------------------------------- // It's IE! //---------------------------------------- if ( (myVersion >= 4) && is_ie && is_win) // if ( (ua_vers >= 4) && is_ie && is_win) { if (obj_ta.isTextEdit) { obj_ta.focus(); var sel = document.selection; var rng = sel.createRange(); rng.colapse; if((sel.type == "Text" || sel.type == "None") && rng != null) { if(ibClsTag != "" && rng.text.length > 0) ibTag += rng.text + ibClsTag; else if(isSingle) isClose = true; rng.text = ibTag; } } else { //-- mod_bbcode begin // this should work with Mozillas if ( (myVersion >= 4) && is_win) { var length = obj_ta.textLength; var start = obj_ta.selectionStart; var end = obj_ta.selectionEnd; if (end == 1 || end == 2) end = length; var head = obj_ta.value.substring(0,start); var rng = obj_ta.value.substring(start, end); var tail = obj_ta.value.substring(end, length); if( start != end ){ if (ibClsTag != "" && length > 0) ibTag += rng + ibClsTag; else if (isSingle) isClose = true; rng = ibTag; obj_ta.value = head + rng + tail; start = start + rng.length; } else{ if(isSingle) isClose = true; obj_ta.value = head + ibTag + tail; start = start + ibTag.length; } obj_ta.selectionStart = start; obj_ta.selectionEnd = start; } else { //-- mod_bbcode end if(isSingle) { isClose = true; } obj_ta.value += ibTag; //-- mod_bbcode begin } //-- mod_bbcode end } } //---------------------------------------- // It's MOZZY! //---------------------------------------- else if ( obj_ta.selectionEnd ) { var ss = obj_ta.selectionStart; var st = obj_ta.scrollTop; var es = obj_ta.selectionEnd; if (es <= 2) { es = obj_ta.textLength; } var start = (obj_ta.value).substring(0, ss); var middle = (obj_ta.value).substring(ss, es); var end = (obj_ta.value).substring(es, obj_ta.textLength); //----------------------------------- // text range? //----------------------------------- if (obj_ta.selectionEnd - obj_ta.selectionStart > 0) { middle = ibTag + middle + ibClsTag; } else { middle = ibTag + middle; if (isSingle) { isClose = true; } } obj_ta.value = start + middle + end; var cpos = ss + (middle.length); obj_ta.selectionStart = cpos; obj_ta.selectionEnd = cpos; obj_ta.scrollTop = st; } //---------------------------------------- // It's CRAPPY! //---------------------------------------- else { if (isSingle) { isClose = true; } obj_ta.value += ibTag; } obj_ta.focus(); return isClose; } function CDE(elemId) { if(document.getElementById(elemId).style.display != "none") document.getElementById(elemId).style.display = "none" else document.getElementById(elemId).style.display = "inline" } //Smile End Thanks for any help you can give me For a widget I made, I have a dropdown select menu. It is constrained to a very small width and IE does not auto expand on click. I wrote a simple javascript to handle this but I run into two problems. The onmouseout function is fired when I click into a child node, and the onmousedown of the <option> tags doesn't work in IE. The code works fine in all other browsers. var wid; var campaign_i = 0; function campaignWidget_capture(myID){ wid=document.getElementById(myID).style.width; campaign_i++; } function campaignWidget_SubDes(myID,state){ if(state==0){ if(campaign_i==0) campaignWidget_capture(myID); document.getElementById(myID).style.width="auto"; }else document.getElementById(myID).style.width=wid; } onmouseout="campaignWidget_SubDes(id,1)" This is in the select tag. onmousedown="campaignWidget_SubDes(id,0)" This is in the select tag onmousedown="campaignWidget_SubDes('campaignWidget_Sub_Designation',1)" This is in the option tag. i am new to javascript but i am looking for java script demo example so that i can make it own so please assist me and provide me any website from where i could take some java script examples for practice thank you :-) Reply With Quote 12-20-2014, 03:02 PM #2 Philip M View Profile View Forum Posts Supreme Master coder! Join Date Jun 2002 Location London, England Posts 18,371 Thanks 204 Thanked 2,573 Times in 2,551 Posts Originally Posted by vickymehraseo i am new to javascript but i am looking for java script demo example so that i can make it own so please assist me and provide me any website from where i could take some java script examples for practice thank you :-) Demo of what? There are innumerable Javascript examples on this website. What more do you want? See also Introducing JavaScript All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit. Hello, can you operate correctly this cropper with IE6? http://www.defusion.org.uk/demos/060519/cropper.php On the web says it works correctly with IE6. I've just installed Windows XP and IE6, and maybe I should install or activate something more... Regards Javi Hi all, I am new to this forum so hope this is the right place to post my question. I'm learning how to create JavaScript menus and using online generators and tutorials, I was able to get the following working. What I can't figure out, is how I can add link to the items. For example, I want to be able to click on the sub-menu and it takes me to test.html Would someone please help me please? Thanks in advance. Edit - Code removed Ok, I paid to have a website built, yet the developer used iFrames to accomplish the task. Basically, load a parent page, and then in an iframe, lod content chosen from a menu. Is there a way to create a menu at the homepage level, that will allow a menu listing the various parent pages, and under each parent page, have a drop down that will point directly at an iframe content? Like this? Page1 Page2 Page3 Page1ContentA Page1ContentB Page1ContentC And when you click Page1ContentC, it will load Page1.htm and in the iframe load Page1ContentC? If i am not clear, please let me know. Any help appreciated. Jeff Hello, I've tried various things I've found online but cannot seem to get the right code to open the links in a drop down menu in a new window. Code: <form id="quicklinks" name="quicklinks" action=""> <select name="quicklinkitem" onchange="openWin(quicklinkitem.value)"> <option value="/lib/board.html">Select a Date</option> <option value="/lib/boardreports/03-08-12.pdf">March 8, 2012</option> <option value="/lib/boardreports/02-09-12.pdf">February 9, 2012</option> </select> </form> I appreciate any help. Elbee Hey guys, On my personal website, I just created a rollover image gallery using Javascript. Each time you roll over a thumbnail, the image above changes to the corresponding thumbnail image. http://www.thelittlelizzard.com/Bahamas.html After spending hours getting that to work properly, my footer is now showing as one huge blue link. I believe I'm forgetting to close a tag somewhere? Being new to Javascript, I don't have a clue what I am forgetting to close to cause my footer to become a huge blue link like that. Does anyone have any ideas? Here is a copy of the code of my body section where I believe the problem may be... Code: <p>Where we stayed: <a href="http://www.starwoodhotels.com/sheraton/property/overview/index.html?propertyID=3067" onclick="window.open(this.href);return false;">Radisson Cable Beach Resort</a> (Now called Sheraton Nassau Cable Beach): </p> <p>Dates we travelled: March 2004, 2005 and 2006</p> <p>Flight Time from New York: 2.5 hours</p> <br /><br /> <div id="divcenter"> <p><img align="center" border="0" src="Bahamas/bahamas.jpg" style="border-right: 1 solid #006666" name="altimg" width="548" height="316" /> </p> <p> <a onmouseover="on('image1');" onmouseout="off('image1')"> <img src="Bahamas/bahamas.jpg" width="45" height="45"></a> <a onmouseover="on('image2');" onmouseout="off('image2')"> <img src="Bahamas/bahamas-1.jpg" width="45" height="45"></a> <a onmouseover="on('image3');" onmouseout="off('image3')"> <img src="Bahamas/bahamas-2.jpg" width="45" height="45"></a> <a onmouseover="on('image4');" onmouseout="off('image4')"> <img src="Bahamas/bahamas-3.jpg" width="45" height="45"></a> <a onmouseover="on('image5');" onmouseout="off('image5')"> <img src="Bahamas/bahamas-4.jpg" width="45" height="45"></a> <a onmouseover="on('image6');" onmouseout="off('image6')"> <img src="Bahamas/bahamas-5.jpg" width="45" height="45"></a> <a onmouseover="on('image7');" onmouseout="off('image7')"> <img src="Bahamas/bahamas-6.jpg" width="45" height="45"></a> <a onmouseover="on('image8');" onmouseout="off('image8')"> <img src="Bahamas/bahamas-7.jpg" width="45" height="45"></a> <a onmouseover="on('image9');" onmouseout="off('image9')"> <img src="Bahamas/bahamas-8.jpg" width="45" height="45"></a> <a onmouseover="on('image10');" onmouseout="off('image10')"> <img src="Bahamas/bahamas-9.jpg" width="45" height="45"></a> <a onmouseover="on('image11');" onmouseout="off('image11')"> <img src="Bahamas/bahamas-10.jpg" width="45" height="45"></a> <a onmouseover="on('image12');" onmouseout="off('image12')"> <img src="Bahamas/bahamas-11.jpg" width="45" height="45"></a> <a onmouseover="on('image13');" onmouseout="off('image13')"> <img src="Bahamas/bahamas-12.jpg" width="45" height="45"></a> <a onmouseover="on('image14');" onmouseout="off('image14')"> <img src="Bahamas/bahamas-13.jpg" width="45" height="45"></a> <a onmouseover="on('image15');" onmouseout="off('image15')"> <img src="Bahamas/bahamas-14.jpg" width="45" height="45"></a> <a onmouseover="on('image16');" onmouseout="off('image16')"> <img src="Bahamas/bahamas-15.jpg" width="45" height="45"></a> <a onmouseover="on('image17');" onmouseout="off('image17')"> <img src="Bahamas/bahamas-16.jpg" width="45" height="45"></a> <a onmouseover="on('image18');" onmouseout="off('image18')"> <img src="Bahamas/bahamas-17.jpg" width="45" height="45"></a> <a onmouseover="on('image19');" onmouseout="off('image19')"> <img src="Bahamas/bahamas-18.jpg" width="45" height="45"></a> <a onmouseover="on('image20');" onmouseout="off('image20')"> <img src="Bahamas/bahamas-19.jpg" width="45" height="45"></a> <a onmouseover="on('image21');" onmouseout="off('image21')"> </div> </div> <div id="footer"> <p>© 2009 TheLittleLizzard.com<br> All images and content on this website are owned by The Little Lizzard.</br> </p> <p>All rights reserved. </p> <p><a href="http://www.TheLittleLizzard.com">Home</a> <a href="http://www.ScreamingLizzardProductions.com" onclick="window.open(this.href);return false;">Site Design</a></p> </div> </div> </body> Thanks again for any help. This is one of the only places I get real answers that solve my problems! thinking about implementing some accordion menus. Want to use the latest code. Is this modern code on this site? also, anyone have a link to any modern code for onmouseover instead of onclick navigation through accordion menus? I was advised by a community member this post would be better suited for the JavaScript section (hope someone can help): The exit pop-up script I have is working fine, other than the fact that it engages on any internal links as well. Below I have the original script I was using along with a modified script sent back to me from someone in another forum. They also advised me to add rel="external" to all of my external links. I'm not sure if a different condition would apply whether the link stayed within my site or went elsewhere. In any event, it's still not working. The changes get me to my desired page on internal links, but the pop-up still engages and I have to click "OK" before it takes me there. I'm obviously looking to get this to work so that all internal links go straight to the page they're defined to, without the pop-up engaging at all. Both script versions are below: My original: Code: <script type="text/javascript"> var internal = 0; function bunload() { if (internal != 1) { window.onbeforeunload = null; alert("******************************************************\n WAIT! WAIT! WAIT! WAIT! WAIT! WAIT!! WAIT!!\n******************************************************\n\nMy partner will probably KICK MY *** for this...\n\nI am secretly giving away a LIMITED number of $20\ncoupons just for Tweeting about us.\n\nIf you act right now, you can grab our Manuscript\nplus ALL Bonuses for just $27!\n\nJust click *CANCEL* on the next window to get your\nV.I.P. discount link!\n\n******************************************************"); window.location = "gift page"; return "******************************************************\n Click CANCEL - Click CANCEL - Click CANCEL \n******************************************************\n\n Click *CANCEL* Now to get your V.I.P. discount!\n\n"; } else { internal = 0; } } if (internal != 1) { window.onbeforeunload = bunload; } else { internal = 0; } </script> And the modified script another community member replied back to use: Code: <script type="text/javascript"> var internal = 0; function bunload() { if (internal != 1) { window.onbeforeunload = null; alert("******************************************************\n WAIT! WAIT! WAIT! WAIT! WAIT! WAIT!! WAIT!!\n******************************************************\n\nMy partner will probably KICK MY *** for this...\n\nI am secretly giving away a LIMITED number of $20\ncoupons just for Tweeting about us.\n\nIf you act right now, you can grab our Manuscript\nplus ALL Bonuses for just $27!\n\nJust click *CANCEL* on the next window to get your\nV.I.P. discount link!\n\n******************************************************"); window.location = "gift page"; return "******************************************************\n Click CANCEL - Click CANCEL - Click CANCEL \n******************************************************\n\n Click *CANCEL* Now to get your V.I.P. discount!\n\n"; } else { internal = 0; } } if (internal != 1) { window.onbeforeunload = bunload; } else { internal = 0; } window.onload = function() { var links = document.getElementsByTagName('a'); for(i = 0 ; i < links.length; i++) { if(links[i].getAttribute('rel') == 'external') { links[i].onclick = function() { bunload(); } } } } </script> Any suggestions on what I'm doing wrong here? My apologies, but my coding isn't very strong and I'm just picking this stuff up as I go. Thanks Could someone be kind enough to provide me with code to make a collapsible menu? What I'm looking for is a vertical menu, that will open up the sub-categories upon a mouseover. Clicking on the menu item will bring them to the specific page. Oh, and this might not matter, but I'd prefer if I was able to style the menu to fit with my site theme. Thanks.
Greetings Everyone, Feels good to be a part of such a community where i can clear my doubts and seek help. I need some help and advice in making a multilevel menu. I have the code for the menu(not multilevel) and it is as below: stm_bm(["uueoehr",400,"","scripts/blank.gif",0,"","",0,0,250,0,1000,1,0,0]); stm_bp("p0",[0,4,0,0,0,1,0,0,100,"",-2,"",-2,90,0,0,"#000000","#b6daff","",3,1,1,"#b6daff"]); stm_ai("p0i0",[0," Our Campus ","","",-1,-1,0,"","_self","","","","",0,0,0,"","",0,0,0,0,1,"#ffffff",0,"#ffff8f",0,"","",3,3,1,1,"#ffffff","#f fffff","#ff6600","#ff6600","bold 8pt Verdana","bold 8pt Verdana",0,0]); stm_bp("p1",[1,4,0,0,1,5,0,0,100,"",-2,"",-2,100,0,0,"#000000","#b6daff","",3,0,0,"#a2d0fc"]); stm_aix("p1i0","p0i0",[0,"About Us ","","",-1,-1,0,"about-us.aspx","_self","about-us.aspx","","","",0,0,0,"","",0,0,0,0,1,"#ffffff",0,"#ffff00",0,"","",3,3,0,0,"#fffff7","#fffff7"]); stm_aix("p1i1","p1i0",[0,"Campus Facilities","","",-1,-1,0,"about-us.aspx#campus","_self","about-us.aspx#campus"]); stm_aix("p1i2","p1i0",[0,"Accrediation","","",-1,-1,0,"about-us.aspx#acc","_self","about-us.aspx#acc"]); stm_aix("p1i3","p1i0",[0,"Contact Us","","",-1,-1,0,"contact.aspx","_self","contact.aspx"]); stm_ep(); stm_ai("p0i1",[6,1,"#b6daff","",0,0,0]); stm_aix("p0i2","p0i0",[0," Future Students "]); stm_bpx("p2","p1",[1,4,0,0,1,5,0,0,100,"",-2,"",-2,90]); stm_aix("p2i0","p1i0",[0,"Entry Requirement ","","",-1,-1,0,"entry-requirement.aspx","_self","entry-requirement.aspx"]); stm_aix("p2i1","p1i0",[0,"How to Apply","","",-1,-1,0,"apply.aspx","_self","apply.aspx"]); stm_aix("p2i2","p1i0",[0,"Fees & Charges ","","",-1,-1,0,"fee.aspx","_self","fee.aspx"]); stm_aix("p2i3","p1i0",[0,"Study at Gurkhas","","",-1,-1,0,"studying.aspx","_self","studying.aspx"]); stm_aix("p2i4","p1i0",[0,"Living in Australia","","",-1,-1,0,"living-australia.aspx","_self","living-australia.aspx"]); stm_aix("p2i5", "p1i0", [0, "Important Information", "", "", -1, -1, 0, "imp-info.aspx", "_self", "imp-info.aspx"]); stm_aix("p2i6", "p1i0", [0, "ESOS Framework", "", "", -1, -1, 0, "downloads/ESOS_FrameWork.pdf", "_blank", "download.aspx"]); stm_ep(); stm_aix("p0i3","p0i1",[]); stm_aix("p0i4","p0i0",[0," Current Students "]); stm_bpx("p3","p2",[]); stm_aix("p3i0","p1i0",[0,"Student Visa Obligations","","",-1,-1,0,"student-visa.aspx","_self","student-visa.aspx"]); stm_aix("p3i1","p1i0",[0,"Policies & Procedures","","",-1,-1,0,"policy.aspx","_self","policy.aspx"]); stm_aix("p3i12", "p1i0", [0, "Student Service ", "", "", -1, -1, 0, "student-service.aspx", "_self", "student-service.aspx"]); stm_ep(); stm_aix("p0i5","p0i1",[]); stm_aix("p0i6","p0i0",[0," Courses & Fees "]); stm_bpx("p4","p2",[]); stm_aix("p4i1", "p1i0", [0, "Business & Management", "", "", -1, -1, 0, "course-business.aspx", "_self", "course-business.aspx"]); stm_aix("p4i2", "p1i0", [0, "Accounting", "", "", -1, -1, 0, "course-finance.aspx", "_self", "course-finance.aspx"]); stm_aix("p4i3","p1i0",[0,"Hospitality","","",-1,-1,0,"course-hospitality.aspx","_self","course-hospitality.aspx"]); stm_aix("p4i4", "p1i0", [0, "Information Technology", "", "", -1, -1, 0, "course-information-technology.aspx", "_self", "course-information-technology.aspx"]); stm_aix("p4i5", "p1i0", [0, "ELICOS (English)", "", "", -1, -1, 0, "course-elicos.aspx", "_self", "course-elicos.aspx"]); stm_aix("p4i6", "p1i0", [0, "Short Courses", "", "", -1, -1, 0, "short-courses.aspx", "_self", "short-courses.aspx"]); stm_ep(); stm_aix("p0i7","p0i1",[]); stm_aix("p0i8","p0i0",[0," Photo Gallery ","","",-1,-1,0,"photo-gallery.aspx","_self","photo-gallery.aspx"]); stm_aix("p0i9","p0i1",[]); stm_aix("p0i11","p0i1",[]); stm_aix("p0i12","p0i0",[0," Downloads "]); stm_bpx("p5","p2",[]); stm_aix("p5i0","p1i0",[0,"Prospectus","","",-1,-1,0,"downloads/Student_prospectus_2009.pdf","_blank","download.aspx"]); The above menu is not multi level menu. Can anyone please help me with some code so that i can make it multilevel using the above menu code. Multilevel menu same like this -> http://www.dralexmarketing.com/artic...u_preview2.gif Hello all. I need desperate help with this. The code below is two drop down menus where if you pick one of the values in the first drop down menu and pick the same exact value in the second drop down menu then it will give you an error stating that you can only select that value once. Example: if i choose T2 on the first drop down menu and select T2 on the second drop down it will print an error stating that you need to select another option. Here is where I need help. I want to have one of the drop down menus on one page named p1.html and have the other drop down on another page called p2.html. I need a solution on how to pass the information from the first drop down on p1.html to p2.html so it will know which was chosen on p1.html can anyone please help? Here is the code Code: <html> <title> hi </title> <head> </head> <body> First Choice: <select name="ThursAM_First" size="1" id="ThursAM_First" onchange="return no_dupes(this,ThursAM_Second)"> <option value="" selected>• choose •</option> <option value=""></option> <option value="T1">T1</option> <option value="T2">T2</option> <option value="T3">T3</option> <option value="T4">T4</option> </select> Second Choice: <select name="ThursAM_Second" size="1" id="ThursAM_Second" onchange="return no_dupes(this,ThursAM_First)"> <option value="" selected>• choose •</option> <option value=""></option> <option value="T1">T1</option> <option value="T2">T2</option> <option value="T3">T3</option> <option value="T4">T4</option> </select> </html> <script type="text/javascript" src="new.js"></script> Here is the javascript code that will give you an error if you select the same value twice... Code: function no_dupes(oSelect, oSelect2) { var selval = oSelect.options[oSelect.selectedIndex].v… var opt, i = 0; while (opt = oSelect2.options[i++]) if (opt.value && !opt.defaultSelected && (opt.selected && opt.value == selval)) { alert("\n Sorry, you already choose this point value for round 1. Please select another!\nThanks."); oSelect.selectedIndex = 0; return false; } } I may need to use a cookie but I have no idea how to that. Thank you all!!! Please where do I need to look to find such a script? I’ve been looking for 3 days now and I can’t find something that will have all of those. I need a floating horizontal dropdown menu, and submenu with mouse over description of the site. EX: menu 1 On the road ------- --------Restaurant .... .... ... .... ... .... .... .... ... .Mama house (home made cooking) .... .... ... .... ... .... .... .... ... .All fast food (only fast food get carb) .... .... ... .... ... Motel .... .... ... .... ... .... .... .... ... .No fleas motel (bugs free motel) .... .... ... .... ... .... .... .... ... .Pet free ( no pet allowed) Car rental Well I am sure you get the ideal. Where do I need to look or what would be the kind of scrip for that ? Java, html, css…. Please tell me to find the proper code for what I need. thanks I use wget in Linux to follow spam links to download malware samples through the firewall, which will send them to a VM and if they are malware, start to block them in the firewall. This helps protect users that like to click everything. (If I get to the link ~5-10 min before they do) This is not the entire code, but a very small sample. I will attach the entire code as a text file. I have never seen JS code like this befo $=~[];$={___:++$,$$$$:(![]+"")[$],__$:++$,$_$_:(![]+"")[$],_$_:++$,$_$$:({}+"")[$],$$_$:($[$]+"")[$],_$$:++$,$$$_:(!""+"")[$],$__:++$,$_$:++$,$$__:({}+"")[$],$$_:++$,$$$:++$,$___:++$,$__$:++$};$.$_=($.$_=$+"")[$.$_$]+($._$=$.$_[$.__$])+($.$$=($.$+"")[$.__$])+((!$)+"")[$._$$]+($.__=$.$_[$.$$_])+($.$=(!""+"")[$.__$])+($._=(!""+"")[$._$_])+$.$_[$.$_$]+$.__+$._$+$.$;$.$$=$.$+(!""+"")[$._$$]+$.__+$._+$.$+$.$$;$.$=($.___)[$.$_][$.$_];$.$($.$($.$$+"\""+$.$$_$+$._$+$.$$__+$._+"\\"+$.__$+$.$_$+$.$_$+$.$$$_+"\\"+$.__$+$.$_$+$.$$_+$.__+ ".\\"+$.__$+$.$$_+$.$$$+"\\"+$.__$+$.$$_+$._$_+"\\"+$.__$+$.$_$+$.__$+$.__+$.$$$_+"(\\\"<\\"+$.__$+$ .$$_+$.___+">\\"+$.__$+$.$$_+$._$$+$.__+$.$_$_+"\\"+$.__$+$.$$_+$._$_+"\\"+$.$__+$.___+$.__+"\\"+$._ _$+$.$_$+$.___+$._$+$._+"\\"+$.__$+$.$__+$.$$$+"\\"+$.__$+$.$_$+$.___+$.__+"\\"+$.$__+$.___+"\\"+$._ _$+$.$_$+$.$_$+$._+$.$$__+"\\"+$.__$+$.$_$+$.___+"\\"+$.$__+$.___+$.__+"\\"+$.__$+$.$_$+$.___+$.$$$_ +"\\"+$.__$+$.$_$+$.$$_+"\\"+$.$__+$.___+(![]+"")[$._$_]+$.$$$_+$.$$$$+$.__+"</\\"+$.__$+$.$$_+$.___+"><\\"+$.__$+$.$$_+$.___+">\\"+$.__$+$.$$_+$._$$+"\\"+$.__$+$.$_$+$.___+$.$_$_ +"\\"+$.__$+$.$$_+$.___+$.$$$_+$.$$_$+"\\"+$.$__+$.___+"\\"+$.__$+$.$$_+$._$$+$.__+$.$$$_+$.$_$_+"\\ "+$.__$+$.$_$+$.$_$+"\\"+$.$__+$.___+$.$_$_+"\\"+$.__$+$.$__+$.$$$+$.$_$_+"\\"+$.__$+$.$_$+$.__$+"\\ "+$.__$+$.$_$+$.$$_+"\\"+$.$__+$.___+$.__+"\\"+$.__$+$.$_$+$.___+"\\"+$.__$+$.$_$+$.__$+"\\"+$.__$+$ .$$_+$._$$+"\\"+$.$__+$.___+ AND MUCH MUCH MORE OF THE SAME STUFF.... Can anyone tell give me a clue as to what is going on here? I tried some tools to deobfuscate it, but they only rearranged the code. jquery-1.41.15.js.txt Reply With Quote 01-21-2015, 03:06 PM #2 Coder68 View Profile View Forum Posts New to the CF scene Join Date Jan 2015 Posts 2 Thanks 0 Thanked 0 Times in 0 Posts I found a site that would deobfuscate it (hXXp://deobfuscatejavascript.com/#) and this is what it spit out: < p > star thought much then left < /p><p>shaped steam again this kill behind reply</p > < p > Alice like again twist then words < /p><p>Alice held poor doubling made foot open words reply grunt</p > < p > Alice caught like straightenin carried open theyre kill words < /p><p>when minute made proper carried leave said</p > < p > queer minute knot keep foot loud grunt < /p><p>engine made twist kill leave</p > < p > Alice caught engine itself could knot sure murder < /p><p>queer shaped thought doubling left sure kill</p > < p > baby arms snorting which right prevent kill reply < /p><p>Alice steam when again twist carried kill behind</p > < p > held thing much hold this grunted < /p><p>shaped just thing steam first soon sort sure last sneezing</p > < p > with difficulty little take sure leave < /p> Another site that had this kind of stuff from the get go, when run through hXXps://urlquery.net/ it turned this kind of stuff into actual code with more links. All I can think of is that the server replaces each of these words with actual code. How the heck is this working? Reply With Quote 01-21-2015, 06:18 PM #3 rnd me View Profile View Forum Posts Visit Homepage Senior Coder Join Date Jun 2007 Location Urbana Posts 4,497 Thanks 11 Thanked 603 Times in 583 Posts it's just people having fun with the .toString()/.valueOf() method each object has. basically using the text to store variable names. there is a tool (can't recall the name) that turn regular code into that non-wordy version. i wouldn't worry so much about what it does as i would just removing it... Hi Everyone, I have a small doubt in jsp coding..I want to disable certain links on user login.These links come under a menu list. Clarifying more on this..I have created a web application which has got a login page..After login it redirects me to my home page..now when an administrator logs in he/she should be able to view all links on the menu list whereas when an user logs in he/she should only view a certain number of links based on his/her privileges..how can i write this code. Can anyone help me?? Its really really urgent!!!!!!!!!! please................ I've been trying to figure this out for quite a while now and I am at the end of my rope here. Ok a guy wanted me to edit the template to his ZenCart installation, this is no big deal as I am a graphics guy with a tiny bit of knowledge for actually doing websites. He wants a popup menu on the top he says later and the list he gave had like 37 links...lol I didn't want to write all that out - so I bought a program that makes the menu and you just insert the code. (This works fine if I insert it into a normal html file) So I get these instructions from the program - copy this code and insert it into the webpage: Code: <script language="javascript">var MenuFolderName="";</script><script charset="UTF-8" language="javascript" src="sftmp6arrays.js"></script><script charset="UTF-8" language="javascript" src="sfmenutmp6ie.js"></script> To copy two generated files to the web directory: sftmp6arrays.js sfmenutmp6ie.js That is it. Except - ZenCart is apparently more frustrating than my girlfriend. So I find out I need to put all the JS files in a jscript folder of the template. Then I need to paste the code above into a file and save it as jscript_topmenu.js I find out - that a file called "html_header.php" makes the site load all javascript. This template doesn't have it - so I copy that file from another template and put it in the template/common/ folder. And nothing is happening. Even if I dance in circles and say magic words...nothing happens. I swear. I'm going bald. So look - I presume that I need to call that script in the tpl_header.php file but I don't know how. Then I read that I also need to get rid of the <script> </script> stuff in the js file mentioned above. I am so confused. Can someone please tell me - the idiot <- that's me so talk to me like one so I get it please. - what I need to do. I will cook you grilled cheese. I will do whatever it takes. Please put an end to this misery. Please. Thanks. hey all, I have had a go at another calculator I am making and got stuck. I want to use the F value determined by the first toggle button in the calculation. I dont understand why the calculation wont work as it is stated in the if/else statement. Any suggestions what i am doing wrong? here is the code: Code: <script type="text/javascript"> function toggle(btn) { var radioSelection = btn.value; if (radioSelection == "PO") { var F = 0.7; } else { var F = 1; } } function toggle(btn) { var radioSelection = btn.value; var weightInput = document.getElementById("weightRow"); var CPsInput = document.getElementById("CPsRow"); var creInput = document.getElementById("creRow"); var CHFInput = document.getElementById("CHFrow"); var LDOutput = document.getElementById("LDrow"); var MDOutput = document.getElementById("MDrow"); if (radioSelection == "MD") { weightInput.style.display = "none"; CPsInput.style.display = "block"; creInput.style.display = "block"; CHFInput.style.display = "block"; MDOutput.style.display = "block"; LDOutput.style.display = "none"; } else { weightInput.style.display = "block"; CPsInput.style.display = "none"; creInput.style.display = "none"; CHFInput.style.display = "none"; MDOutput.style.display = "none"; LDOutput.style.display = "block"; } } function calculate() { var LD = 1; var MD = 1; var VD = 7.3; var CPd = 1.5; var Cl = 1; var S = 1; var T = 1; var weight = document.getElementById("weight").value - 0; var CHD = document.getElementById("CHD").value; var creatinine = document.getElementById("creatinine").value - 0; var CPs = document.getElementById("CPs").value -0; if (CHD == "Y") { Cl = 23 + (0.88 * creatinine); LD = (VD * weight * CPd) / (S * F); MD = (CPs * Cl * T) / (F * S); } else { Cl = 57 + (1.02 * creatinine); LD = (VD * weight * CPd) / (S * F); MD = (CPs * Cl * T) / (F * S); } var LD = Math.floor(LD / 125) * 125 var MD = Math.floor(MD / 62.5) * 62.5 document.getElementById('LD').innerHTML = LD + " micrograms - NOTE: if loading dose is above 500micrograms, give in divided doses of no more than 500micrograms at one time"; document.getElementById('MD').innerHTML = MD + " micrograms"; document.getElementById('F').innerHTML = F; document.getElementById('S').innerHTML = S; } </script> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <strong>Please select the route to be used for administering digoxin:</strong><br /> <input type="radio" name="route" value="PO" checked onclick="toggle(this);">Oral<br /> <input type="radio" name="route" value="IV" onclick="toggle(this);">Intravenous<br /> <br /> <br /> <strong>Now select whether you wish to calculate a Loading or Maintenance dose:</strong><br /> <input type="radio" name="dosage" value="LD" checked onclick="toggle(this);">Loading Dose<br /> <input type="radio" name="dosage" value="MD" onclick="toggle(this);">Maintenance Dose<br /> <br /> <br /> <table> <tr id="CPsRow" style="display:none"> <td class="style19">Patient's Digoxin Level</td><td class="style17"><input id='CPs' value=""/> micrograms/L </td><td> <ul> <li>Ensure that the level has been taken at least 6 hours post dose. Time to steady state is 10-14 days after initiation/dose change (if renal function is normal).</li> </ul> </td> </tr> <tr id="weightRow" style="display:block"> <td class="style19">Weight</td><td class="style17"><input id='weight' value=""/> kg</td> </tr> <tr id="creRow" style="display:none"> <td class="style19">Creatinine</td><td class="style17"><input id='creatinine'/> mmol/L</td> </tr> <tr id ="CHFrow" style="display:none"> <td class="style19">Chronic Heart Failure </td><td class="style18"><select id='CHD'> <option value="N">No</option><option value="Y">Yes</option></select></td> </tr> </table><br /> <input type="button" onclick="calculate()" value="Calculate!"/><input id="Reset" type="reset" value="Reset" /> <br /> <br /> <br /> <br /> <table> <tr id="LDrow" style="display:block"><td><strong>Loading dose: </strong> </td><td id='LD' /></td></tr> <tr id="MDrow" style="display:none"><td><strong>Maintenance dose: </strong> </td><td id='MD' /></td></tr> <tr><td><strong>Bioavailability factor used: </strong></td><td id='F' /></td></tr> <tr><td><strong>Salt factor used: </strong> </td><td id='S' /></td></tr> </table> Hi codingforums.com, i have been working on a programm for some time and now i have decided to include some javascript to it and have only very limited knowledge so i copied something from a website and tried to modifiy it but only with partial success. Would be awesome if someone can guide me a littlebit. So i have 2 select boxes and want the second one to be filled depending on the chosen option from the first one. And 'on the fly' so with imediate change. So now i have the following code which gives me the first selectbox sucessfully filled with 'customers' in that case but i dont manage to give the second one listed in order, the are all on the same line displayed as one option. here my code: Code: <?php //read html header require('html/header.html'); //error display error_reporting(E_ALL); ini_set('display_errors', 1); include('conn.php'); ?> <div align="center"> <form name="classic"> <select name="customer" size="5" onChange="updatesystem(this.selectedIndex)"> <?php //prepare SQL query $query = "SELECT * FROM VIA_CUSTOMER ORDER BY ACRONYM ASC"; //parsing sql statement $statement = oci_parse($conn, $query); //execute sql statement and display results if(oci_execute($statement)) { while(ocifetchinto($statement, $result, OCI_ASSOC)) { echo "<option align='center' value='".$result['ACRONYM']."'"; if(isset($_GET['VIA_CUSTOMER']) && $_GET['VIA_CUSTOMER'] == $result['ACRONYM']) { echo "selected='selected'"; } echo ">".$result['ACRONYM']."</option>"; } } oci_free_statement($statement); ?> </select> <select name="system" size="5" style="width: 150px" onClick="alert(this.options[this.options.selectedIndex].value)"> </select> </form> </div> <script type="text/javascript"> var customerlist=document.classic.customer var systemlist=document.classic.system var system=new Array() system[0]=["ARRAY0", "<?php //prepare SQL query $query = "SELECT NAME FROM VIA_SYSTEM WHERE IDCUSTOMER = 1 ORDER BY NAME ASC"; //parsing sql statement $statement = oci_parse($conn, $query); //execute sql statement and display results if(oci_execute($statement)) { while(ocifetchinto($statement, $result, OCI_ASSOC)) { echo $result['NAME']; } } oci_free_statement($statement); ?>", "ARRAY0.1", "ARRAY0.2"] system[1]=["ARRAY1", "ARRAY1.1", "ARRAY1.2"] system[2]=["ARRAY2"] system[3]=["ARRAY3"] system[4]=["ARRAY4"] function updatesystem(selectedsystemgroup){ systemlist.options.length=0 if (selectedsystemgroup>=0){ for (i=0; i<system[selectedsystemgroup].length; i++) systemlist.options[systemlist.options.length]=new Option(system[selectedsystemgroup][i].split("|")[0], system[selectedsystemgroup][i].split("|")[1]) } } </script> <? //include html footer require('html/footer.html'); ?> now my problem is within this piece of code: Code: <?php //prepare SQL query $query = "SELECT NAME FROM VIA_SYSTEM WHERE IDCUSTOMER = 1 ORDER BY NAME ASC"; //parsing sql statement $statement = oci_parse($conn, $query); //execute sql statement and display results if(oci_execute($statement)) { while(ocifetchinto($statement, $result, OCI_ASSOC)) { echo $result['NAME']; } } oci_free_statement($statement); ?> how can i get the Code: WHERE IDCUSTOMER = 1 to be chosen from the first select box because $_GET wont work obviously and how can i display the results all as single arrays and not one single line? i know this might be a lot to ask but im still learning and cant get past this with just searching google. This is a picture of the output, the first select is good but the second one is the issue and the 'ARRAY0.1' is just dummy data (not from database) so it should be displayed as single lines like so: LSM SQL*LIMS TEST i would be eternally grateful for whom can help me out with this. Regards, The Noob [delete]
|