JavaScript - Error: Identifier Starts Immediately After Numeric Literal
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?? Similar TutorialsI just noticed that my pseudo-streaming movie code causes an error with IE7. I works fine with IE8, FireFox, Chrome... I have been looking on my own and found that it's likely a misplaced comma in my code, the other browser are debugging it, but IE7 will not. The error suggests it's where I have indicated below. I've tried removing the comma just after "about_us.jpg" and that causes the script to fail completely. Can anyone help me here, please? Code: <script type="text/javascript"> //<![CDATA[ flowplayer("player", {src: "http://www.mysite.org/flowplayer/flowplayer.commercial-3.2.5.swf", wmode: 'opaque'}, { // product key from your account key: '#$xxxxxxxxx', // configure clip to use "lighthttpd" plugin for providing video data playlist: [ { url: 'http://www.mysite.org/media/video/about_us.jpg', }, //<----error suggest here??? { url: 'http://www.mysite.org/flowplayer/streamer.php?file=about_us.flv', provider: 'lighttpd', bufferLength: "2", autoBuffering: false }], // streaming plugins are configured normally under the plugins node plugins: { lighttpd: { url: 'http://www.mysite.org/flowplayer/flowplayer.pseudostreaming-3.2.5.swf', // use ${start} as a placeholder for the target keyframe queryString:escape('&start=${start}') } } }); //]]> </script> Hey guys, I've been learning Javascript for a few days using code academy. I've come across this issue, and I'm not sure what exactly I'm doing wrong. Any help would be great. // Check if the user is ready to play! confirm("I am ready to play!"); var age = prompt("What's your age?"); if (age < 13) { console.log("I take no responsiblity, but you are allowed to play") } else { console.log("Have fun!") } console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'") console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'") var userAnswer = prompt("Do you want to race Bieber on stage?"); if userAnswer === "yes" { console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!"); } else { console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'"); } Hi guys , i am getting this error " unterminated string literal" but iam unable to locate the problem..iam using fire bug for firefox.. any idea from where this error comes ? thanks So I can't figure out why I keep getting the error.... Code: unterminated string literal document.write("<input type=\"button\ value=\"" + phrases [i][j] + "\" Code: <form name="pirateForm"> <div align="center"> <script type="text/javascript"> phrases = [["Greetings","hello","pardon me","excuse me","hows it going"], ["People","sir","madam","woman","children"], ["Questions","where is","can you help me find","is that","how far is it to?"], ["Ariticles","the","my","your","there"], ["Adjectives","outstanding","attractive","happy","dead"], ["places","restroom","restaurant","hotel","pub"], ["Desires","I would like to","I desire","I wish I knew how to","my mother told me to"], ["Actions","have a great dinner","have a cocktail","fall on the ground","get drunk"]]; for(var i = 0; i < phrases.length; i++) { var category = phrases[i][0]; document.write("<tr valign='top'><td>" + category + ": <td>"); for(var j = 1; j < phrases [i].length; j+=2) { document.write("<input type=\"button\ value=\"" + phrases [i][j] + "\" onClick='document.pirateForm.Output.value += \"" + phrases [i][j+1] + "\";'>\n"); } } </script> </div> <div align="center"> <textarea id="task_list" rows="5" cols="130"></textarea> <input type="button" value="Clear" onClick="this.form.reset()" /> </div> </div> </form> im sure its the scripting, im new to js, can anyone Tell me why im getting these 2 error messages? thank you!!!!!!! detailed error: unterminated string literal Error: onPageUnload is not defined function writeMovie1() {detectBrowser();if(windowsInternetExplorer) {document.write('<object id="id3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="150" height="16" style="height: 0px; left: 160px; position: absolute; top: 150px; width: 150px; z-index: 1; "><param name="src" value="musicfiles/VenusStereo.m4a" /><param name="controller" value="false" /><param name="autoplay" value="true" /><param name="scale" value="tofit" /><param name="volume" value="100" /><param name="loop" value="true" /></object>');} else if(isiPhone) {document.write('<object id="id3" type="video/quicktime" width="150" height="16" style="height: 0px; left: 160px; position: absolute; top: 150px; width: 150px; z-index: 1; "><param name="src" value="musicfiles/VenusStereo.m4a"/><param name="controller" value="false"/><param name="scale" value="tofit"/></object>');} else {document.write('<object id="id3" type="video/quicktime" width="150" height="16" data="musicfiles/VenusStereo.m4a" style="height: 0px; left: 160px; position: absolute; top: 150px; width: 150px; z-index: 1; "><param name="src" value="musicfiles/VenusStereo.m4a"/><param name="controller" value="false"/><param name="autoplay" value="true"/><param name="scale" value="tofit"/><param name="volume" value="100"/><param name="loop" value="true"/></object>');} setTransparentGifURL('Media/transparent.gif');function applyEffects() {var registry=IWCreateEffectRegistry();registry.registerEffects({stroke_0:new IWStrokeParts([{rect:new IWRect(-5,5,10,467),url:'Welcome_files/stroke.png'},{rect:new IWRect(-5,-5,10,10),url:'Welcome_files/stroke_1.png'},{rect:new IWRect(5,-5,705,10),url:'Welcome_files/stroke_2.png'},{rect:new IWRect(710,-5,11,10),url:'Welcome_files/stroke_3.png'},{rect:new IWRect(710,5,11,467),url:'Welcome_files/stroke_4.png'},{rect:new IWRect(710,472,11,10),url:'Welcome_files/stroke_5.png'},{rect:new IWRect(5,472,705,10),url:'Welcome_files/stroke_6.png'},{rect:new IWRect(-5,472,10,10),url:'Welcome_files/stroke_7.png'}],new IWSize(716,477))});registry.applyEffects();} function hostedOnDM() {return true;} function onPageLoad() {loadMozillaCSS('Welcome_files/WelcomeMoz.css') adjustLineHeightIfTooBig('id1');adjustFontSizeIfTooBig('id1');adjustLineHeightIfTooBig('id2');adjust FontSizeIfTooBig('id2');Widget.onload();fixupAllIEPNGBGs();fixAllIEPNGs('Media/transparent.gif');applyEffects()} function onPageUnload() {Widget.onunload();} 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. Code: 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"); } I am trying to figure out how to code this type of horizontal navigation like this site. http://www.maxdesign.com.au/ When you click on, say, "News", the CSS button turns red and white. I am thinking that this is done with JavaScript and a basic CSS list menu. But I cannot seem to find an example of this the of menu anywhere. The Max Design site is based on WordPress and apparently this navigation uses an API built into the WP framework. I need this type of horizontal menu for a custom coded CSS and PHP site. Any and all help would be appreciated. Either code or point me to a tutorial. Thanks, WiLd Hello I have a question, I bet it's easy for you guys. I have a page "v.php" which's got an iframe that shows different pages for 3 seconds after they have loaded. There is a page "w.php" that needs to be shown in the iframe but it needs to be shown for 10 seconds after it's loaded. How can I make so "w.php" freezes the timer for at least 10 seconds and then let it start? I hope you guys can understand. Thanks! I'm installing a Disqus commenting system on a news site. Javascript attaches a comment thread to the end of a story page, based on the story's url. Our issue is that many stories may have multiple urls, and we want a single comment thread on those stories. A single story may have a url like this: www.newspaper.com/ci_12345678 and this: www.newspaper.com/entertainment/ci_12345678 Disqus provides an alternative var disqus_identifier I'd like to define disqus_identifier to the final 8-digit story ID, read from the url. Here's the way the code looks: Code: <div id="disqus_thread"></div> <script type="text/javascript"> /** * var disqus_identifier; [Optional but recommended: Define a unique identifier (e.g. post id or slug) for this thread] */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://newspaper.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> I'm not sure how to define var disqus_identifier. Can anyone help me out? I have the following code which attaches a function to events in x number of comboboxes (x will probably always = 4, but I do not want to hard-code this). I wish to pass the value of i to the function being attached as well as the value of tempData. In other words, I want the parameters in function to be the value, not a reference variable. In the current example, I am using the hard-coded variable ci. This I want to be replaced by a literal created when the event handler is attached (the value of the loop variable i). Also, notice that I get the filter value in the event handler (assigned to the variable ct). I would like to replace this code with the value of tempData which would also be determined when the evenet is attached (it is the same value in this case, but it keeps the onChange event from having to do this each time it runs). Code: var props = { col_0: "select", col_1: "select", col_2: "select", col_3: "select", btn_reset:true, display_all_text: "-Show All-", on_filters_loaded: function(o){ //reset all filters var slcIndexes = o.GetFiltersByType(o.fltTypeSlc, true); //o.fltTypeSlc = 'select' for(var i=0; i<slcIndexes.length; i++){ //this public method returns a filter DOM element by column index var slcElm = o.GetFilterElement(slcIndexes[i]); //tempData = slcElm.options[slcElm.selectedIndex].text; //window.alert(tempData + " " + slcElm); tf_AddEvent(slcElm, 'change', onchangeFn=function(){ //ci is the column index for the column to filter on. ct is the new text from the combobox to filter on var ci; ci = 2; var ct = tf_outputTable.GetFilterValue(ci); tf_outputTable.ClearFilters(); //window.alert("ci= " + ci + " ct= " + ct); tf_outputTable.SetFilterValue(ci, ct); tf_outputTable.Filter(); }); //end tf_AddEvent } } } setFilterGrid("outputTable",props); I need to find a way to check if a field contains sql commands. To begin with, lets just say as an example:select, delete, drop, truncate <script type="text/javascript"> function validate () { var literals= /select/; user_input = document.forms[0].input1.value.search(literals); if (user_input == -1) { alert("test123"); } } </script> <body> <form > <input type="text" size="25" name="input1" value=" "> <input type="button" onClick="validate()" value="check" /> </form> I am new to JS and regular experssions. How do I make it in my regular expression so not only am I searching for /select/ but also for the other sql commands (or anythign for that matter)... essentially multiple literals... eg if it contains /select OR delete OR truncate/ etc. sorry if this is confusing. let me know if i can help in any other way. thanks guys! I keep getting this error and I'm not sure why var flashvars = {'regkey':"<?php $_GET[regkey]?>",'pkey':"<?php $_GET[pkey]?>"}; unterminated string literal [IMG]chrome://firebug/content/blank.gif[/IMG]var flashvars = {'regkey':"<br />\n Hello, I have the following code: A = { "value" : "a", }; B = A ; B.value = "b"; alert (A.value); // => b I expected A.value to be "a". Can someone explain what I'm thinking wrong? And: how can I change values of a new object, without changing the parent-object ? tnx Hello, I created a simple WYSIWYG for creating CSS based webpages. It works exactly as assumed in Safari and Chrome. However, in firefox, when you copy/paste more than one line of text, instead of formatting it as html, in puts in line breaks causing the array storing all of the data to break into multiple lines and causing an unterminated string literal. Can anyone, 1. suggest why it is behaving this way? 2. suggest a work around to allow it to work on FF? ok so Code: <p> Howdy <p> expressed as a literal string that is passed to the setTimeout() function might look like this: Code: setTimeout("document.getElementById('first').innerHTML = '<p>' + 'HOWDY' + '<\/p>';", 2000); ..so I guess you can't just put quotes around an expression like this: "'<p> HOWDY <\/p>;" So tags have to be isolated, but it get confusing with expressions like this, which I am not sure how to express as a string: Code: <p><h2 class="pos_left"> <img src="car1.jpg" name="slide" width="400" height="250" /> </h2> </p> ^ I wish I could change the " in there to ' and then just wrap the whole thing in double " This is what I came up with but it did not work: Code: setTimeout("document.getElementById('first').innerHTML = '<p>' + '<h2' + 'class='pos_left'' + '>' + '<img' + 'src='car1.jpg'' + 'name='slide'' + 'width='400'' + 'height='250'' + '/>' + '</h2>' + '<\/p>';", 4000); Dear Experts I want textbox1 to accept only numeric data as 55,65,698.00 Is there any easy way to validate textbox1 with javascript? Please help Shouldn't this work? It's letting the form submit to the next page when I add in this if statement: Code: var first = document.forms["contact1"].elements["name"].value; else if (!preg_match("/^[a-z]$/i", first)) { alert("Please enter only letters for your first name"); return false; } |