JavaScript - New Here, Need Some Help Immediately!
Hii guys, I'm new here. I'm currently an employee at Boston Financial Data Services and I need some help coding a MS Sharepoint page (or separate HTML page,) with HTML, CSS, and Javascript all in one.
I've been working with another on trying to get a lightbox to work with my sharepoint page for quite some time and we came across a snag. I want to use this Javascript here in either my Sharepoint content web part or in a separate HTML page (but neither code seem to work with it): Code: <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="imagetoolbar" content="no" /> <title>Manage Portal</title> <script type="text/javascript" src="js/jquery.min.js"></script> <script> !window.jQuery && document.write('<script src="jquery-1.4.3.min.js"><\/script>'); </script> <script type="text/javascript" src="js/jquery.mousewheel-3.0.4.pack.js"></script> <script type="text/javascript" src="js/jquery.fancybox-1.3.4.pack.js"></script> <link rel="stylesheet" type="text/css" href="css/jquery.fancybox-1.3.4.css" media="screen" /> <link rel="stylesheet" href="css/style.css" /> <script type="text/javascript"> $(document).ready(function() { /* * Examples - images */ $("#various3").fancybox({ 'width' : '75%', 'height' : '75%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' }); }); </script> </head> <a id="various3" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/Lists/Messages/NewForm.aspx?RootFolder=%2Fsites%2FDepartmentCommunities%2FInvestorServices%2FISMC2%2FLists%2FMessages&ContentTypeId=0x012002009E73B71E51BD5A4487B5BA4453025B6C&Source=https%3A%2F%2Fbfsiteportal%2Fsites%2FDepartmentCommunities%2FInvestorServices%2FISMC2%2FLists%2FMessages%2FAllItems%2Easpx" target=_blank><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; WIDTH: 238px; BORDER-BOTTOM: 0px solid; HEIGHT: 202px" height=140 alt="Post Message" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/link.png" width=190 border=0></A> </P></TD></TR></TBODY></TABLE> This is the sharepoint "content editor web part" code that works with the default aspx (only used tables to align because separate CSS formatting Sucks with Sharepoint.) Code: <DIV align=center> <TABLE style="WIDTH: 1231px; HEIGHT: 902px" summary="" background=https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/bg.png><BR><BR> <STYLE>A:hover IMG { FILTER: alpha(opacity=30) } </STYLE> <TBODY> <TR> <TD colSpan=8> <P><A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/html/helpfile.html" target=_blank><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; WIDTH: 282px; BORDER-BOTTOM: 0px solid; HEIGHT: 265px" alt=HELP!!! src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/link.png" border=0></A></P> <P> </P> <P> <A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/IDP/Forms/AllItems.aspx" target=_blank><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt=IDP src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/idpbut.png" border=0></A><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt=NQR src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/nqrbut.png" border=0><A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/Command%20Center%20Call%20Totals/Forms/AllItems.aspx" target=_blank><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt="Call Totals" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/ct.png" border=0></A><A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/stats_usage/Sharepoint%20-%20KnowledgeBase%20Usage%202011.xls" target=_blank><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt=NQR src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/kb.png" border=0></A><A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/Quality/Forms/AllItems.aspx?RootFolder=%2fsites%2fDepartmentCommunities%2fInvestorServices%2fQuality%2fQuality%20Analysts%2fNQR%20Reports%20%2d%20Names%20Included&FolderCTID=&View=%7b2D817F74%2d9FF3%2d4326%2d9426%2dA9282BD600DC%7d" target=_blank><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt=NQR src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/nqrbut.png" border=0></A> </P> <P> <A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/ScoreCards/Forms/AllItems.aspx" target=_blank><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt=Scorecards src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/scbut.png" border=0></A><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt=NQR src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/nqrbut.png" border=0><A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/Shared%20Documents/Forms/AllItems.aspx?RootFolder=%2fsites%2fDepartmentCommunities%2fInvestorServices%2fShared%20Documents%2fCommand%20Center%2fDaily%20Reports%2fEfficiency%20Reports&FolderCTID=&View=%7b9A6F0DB3%2d0681%2d4156%2dBB8C%2d19F58142F97A%7d" target=_blank><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt="Efficiency Reports" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/er.png" border=0></A><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt="Mel's RFPs" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/mrfp.png" border=0><A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/Quality/Forms/AllItems.aspx?RootFolder=%2fsites%2fDepartmentCommunities%2fInvestorServices%2fQuality%2fQuality%20Analysts&FolderCTID=&View=%7b2D817F74%2d9FF3%2d4326%2d9426%2dA9282BD600DC%7d" target=_blank><IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid" alt="Quality Folder" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/qf.png" border=0></A> <A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/Lists/Messages/AllItems.aspx" target=_blank></A> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P><A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/html/helpfile.html" target=_blank></A> </P> <P> </P> <P> </P> <P><A title="" href="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/html/helpfile.html" target=_blank></A> </P></TD> <TD colSpan=7> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> </P> <P> <IMG style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; WIDTH: 210px; BORDER-BOTTOM: 0px solid; HEIGHT: 229px" alt=HELP!!! src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/link.png" border=0></P></TD></TR></TBODY></TABLE> <TABLE style="WIDTH: 100%" summary=""> <TBODY></TBODY></TABLE> <P> </P></DIV> <DIV></DIV> <BR> <BR> Now that i figured my javascript wasnt working with the above code on Sharepoint, I opted to make a completely separate HTML page to replace Sharepoint's default ASPX page (seeing that its such a mess with all the nbsp's and crap, css is much cleaner to position the icons that i need in the proper spots. This might confuse some because i'm in a rush to figure this all out. Code: <style type="text/css"> body { background-color:black; width: 1231px; height: 902px; } div.BACKGROUNDD { position: middle; top: 100px; left: 40px; width: 1231px; height: 902px; } div.NQRBUTTON { position: absolute; top: 320px; left: 250px; width: 80px; height: 80px; } div.IDPBUTTON { position: absolute; top: 320px; left: 330px; width: 81px; height: 81px; } div.CTBUTTON { position: absolute; top: 319px; left: 405px; width: 80px; height: 80px; } div.KBBUTTON { position: absolute; top: 323px; left: 485px; width: 77px; height: 77px; } div.QFBUTTON { position: absolute; top: 323px; left: 568px; width: 81px; height: 81px; } div.SCBUTTON { position: absolute; top: 323px; left: 653px; width: 80px; height: 80px; } div.IDPBUTTON1 { position: absolute; top: 323px; left: 733px; width: 80px; height: 80px; } div.KBBUTTON1 { position: absolute; top: 423px; left: 250px; width: 80px; height: 80px; } div.QFBUTTON1 { position: absolute; top: 423px; left: 330px; width: 80px; height: 80px; } div.SCBUTTON1 { position: absolute; top: 423px; left: 405px; width: 80px; height: 80px; } div.container { position: absolute; width: 1231px; height: 902px; margin: 0 auto; text-align: left; } table.center { position: absolute; width: 1231px; height: 902px; margin-left:auto; margin-right:auto; } table#table1 { width:70%; margin-left:10%; margin-right:15%; }</style> <table border="0" class="center" id="table1" style="width: 1231px; height: 902px"> <tbody> <tr> <td> <div class="Backgroundd"> <img border="o" height:="902" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/bg.png" width:="1231" /></div> <div class="NQRBUTTON"> <a href="http://www.google.com"><img position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/nqrbut.png" style="border-right: 0px solid; border-top: 0px solid; border-left: 0px solid; width: 80px; border-bottom: 0px solid; height: 80px" /></a></div> <div class="IDPBUTTON"> <img border="0" height="80" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/idpbut.png" width="80" /></div> <div class="CTBUTTON"> <img border="0" height="80" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/ct.png" width="80" /></div> <div class="KBBUTTON"> <img border="0" height="78" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/kb.png" width="78" /></div> <div class="QFBUTTON"> <img border="0" height="78" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/qf.png" width="78" /></div> <div class="SCBUTTON"> <img border="0" height="81" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/scbut.png" width="81" /></div> <div class="IDPBUTTON1"> <img border="0" height="80" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/idpbut.png" width="80" /></div> <div class="KBBUTTON1"> <img border="0" height="80" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/kb.png" width="80" /></div> <div class="QFBUTTON1"> <img alt="" border="0" height="80" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/qf.png" width="80" /></div> <div class="SCBUTTON1"> <img border="0" height="80" position="absolute" src="https://bfsiteportal/sites/DepartmentCommunities/InvestorServices/ISMC2/images/scbut.png" width="80" /></div> <div> </div> <div> </div> </td> </tr> </tbody> </table> <p> </p> Can anyone tell me why the javascript isnt compatible with either of these codes? I really need this because the lightbox is what my supervisor needs. I would've taken more time to properly introduce myself, but i'm in deperate need to finish this code this week and make it perfect, whether it's in the Sharepoint aspx or through a completely new html to replace the aspx. Thanks in advance. I really appreciate any help available here. Similar TutorialsCode: var x = "blahblah".indexOf("blahblah"); if (x !== -1){ // do something with x alert("Present"); } else { alert("Not present"); } Is there some syntax/code structure that allows something like this: Code: if ( (var x = "blahblah".indexOf("blahblah")) !== -1){ // do something with x alert("Present"); } else { alert("Not present"); } Hi.. I am facing identifier starts immediately after numeric literal error in firefox onclick="document.location.href='<%= themeDisplay.getPathMain() %>/portal/ext/asite/assignOrg'"/> can any 1 solve this?? |