JavaScript - Urgent Help Pls: How To Make A Mature Content Gateway??
Hi, I have advertiser adbrite, and they are pressuring me to create a mature content gateway.
Do you know how on some porn sites it has "click here if you are 18 and older to proceed" and "Click Here to exit if you are not over 18" (redtube.com has an example) I have figured out the easiest way for me to do this is: when a user clicks on a link to mature content, they are redirected to the mature content gateway. the gateway will have options: "Continue" and "Exit" Continue will link them to the original Mature Content URL, while Exit will reffer them to the home page. How would I do this? Similar Tutorialshii i am doing a project and i meet some problem i create a dojo dialog box i need to style the dialog box into whole thing white but i am not able to style the border (the grey line) between the title and content so i was wondering how am i goin to style it into white? i don't use the css to style it so i was wondering how to write it like " noteDlg.titleBar.style.background = 'white'; " this kind to remove the grey line between the title and content thanks ps. I really need it very urgently...hope reply asap function note(){ noteDlg = new dijit.Dialog({ title: "Programatic Dialog Creation", draggable: false, style: "width: 300px; border:0px; " }); // set the content of the dialog: noteDlg.attr("content", "Hey, I wasn't there before, I was added at "); noteDlg.titleBar.style.background = 'white'; noteDlg.show(); } I'm absolutely new to JavaScript and HTML, although I've done a fair amount with Visual Basic (VB6 and macros in Word and Excel). I'm trying to create a form with different sections. When the user checks a checkbox for a section, the table with the input areas for that section will appear; if the user changes his mind and unchecks the box, that table will go away. I've played with the visibility attribute, and that works - sort of. I can hide the table from view, but it's still there in the page, taking up as much room as it does whether visible or not. There's a big empty gap containing an invisible table or two if the user only selects the third or fourth section. Code: function showhide(element){ if(document.getElementById(element).style.visibility=="hidden"){ document.getElementById(element).style.visibility="visible"; document.getElementById(element).style.display="block"; }else{ document.getElementById(element).style.visibility="hidden"; document.getElementById(element).style.display="none"; } } And I played with the height attribute, and that works - to a point. I can only collapse the table ror height when there's nothing in it. But if there's text, or a text box, or a textarea box, the row will not go down to zero, even if that's what I set it to. Code: <tr ID="targetrow" style="height:0px;"></tr> I'm hoping the only solution isn't to write the table into the document on the fly when the box is checked, and then delete it if the box is unchecked. Any help? Ed I have a form with a postcode field in it I want to add a button or text link next to this field which if clicked on goes to the google maps url querying that postcode i.e. if the postcode text in the field (form not submitted) was SW1A 1AA then without submitting that form there would be a button / link next to it which when clicked on went to "http://maps.google.co.uk/?q=SW1A1AA" Pretty sure Java should be able to do this ? im new beginner for jsp coding and java script programming..here,i have a few question about date calculation. 1.duration date between date signed and expired date = display in year 2. from expired date available years, month and day minus with Date Today 3. how to use IF ELSE statement to display status active or inactive (example : active status if more then 8 month or inactive status if less then 8 month) this is my coding...it's right? for years <script language="JavaScript" type="text/javascript"> /*<![CDATA[*/ function DaysMonths(but,nme,op){ var frm=but.form; var dates=frm[nme]; for (var i=0; i<dates.length; i++){ var date=dates[i].value.split('-'); dates[i].date=new Date(date[0]*1,date[1]-1,date[2],0,0,0,0); } var days=(dates[1].date-dates[0].date)/1000/60/60/12; years=(dates[1].date.getFullYear()-dates[0].date.getFullYear()); frm[op].value=years+' years'; } /*]]>*/ </script> i have output : 5 years for month and day <script language="JavaScript" type="text/javascript"> /*<![CDATA[*/ function DaysMonth(but,nme,op){ var d = new Date(); var frm=but.form; var dates=frm[nme]; for (var i=0; i<dates.length; i++){ var date=dates[i].value.split('-'); dates[i].date=new Date(date[0]*1,date[1]-1,date[2],0,0,0,0); } var days=(dates[1].date-dates[0].date)/1000/60/60/24s; var months=dates[1].date.getMonth()-dates[0].date.getMonth(); months=(dates[1].date.getFullYear()-dates[0].date.getFullYear()-d.getDate())*12+(months<0?months:-months); frm[op].value= months + ' month ' +days+ ' day '; } /*]]>*/ </script> my output i have like this : 48 month 1826 day i set date format in my sql like this date signed = 2008-11-18 date expired = 2013-11-18 how can i have output like this for for duration (date expired - date signed) minus date for today = 3 year, 42 month 1826 day sorry for my thread post this morning...not mean like that... I am a beginner so please help ASAP. When I validate my code in validate.w3.org: document.write("<img src='" + myNum +".jpg'/>"); I got an error that said: --- required attribute "alt" not specified Hi, i am new to javascript and i am giving a task to create a javascript page, i need a javascript that will calculate and generate a simple Quotation with total price of item selected and its quantity in a new page and in tabular form, i need this for 2 check-boxs that has the value, 2 dropdownlist and the price.
I have a page in html, containing some text like " ABCDEFGHIJKL" etc. This text has also a website link (hyperlink) with it. This website link changes on each refresh of page. Such link changes due to javascript runing behind on it. I just want this link each time stored in a PHP variable. Such text always appears on a certain position on the page (X,Y). Can you please help me on it.? I can provide additional details on request. Your early answer is required. Regards Ahmed Taufiq I'm a newbie to php and javascript. I want some checkbox to hide some rows of my table so i did a search and i found a few javascript codes but yet I couldn't make it work the way I wanted it. When I uncheck a checkbox ONLY the first table rows get hidden, the other tables don't? can't I ID some rows? Please I need help :( My javascript code is: Quote: <script type="text/javascript"><!-- function showHideTR(idx,vis) { var tbl,row; if(document.getElementById && document.getElementsByTagName) { tbl = document.getElementById('tbl'); if(!tbl || (idx >= tbl.getElementsByTagName('tr').length)) return; row = tbl.getElementsByTagName('tr')[idx]; } else if(document.all && document.all.tags) { // IE4 support tbl = document.all.tbl; if(!tbl || (idx >= tbl.all.tags('tr').length)) return; row = tbl.all.tags('tr')[idx]; } if(row) { if(!vis) { row.style.display = 'none'; } else { // conditional compilation to hide the try-catch blocks from IE4 /*@cc_on @if(!@_jscript || (@_jscript_version >= 5)) @*/ try { row.style.display = 'table-row'; } catch(e) { row.style.display = 'block'; } /*@elif(@_jscript_version < 5) row.style.display = 'block'; // for IE4 @end @*/ } } } function getStyle(el,styleProp) { var x = (typeof(el)=='string')?document.getElementById(el):el; if (x.currentStyle) var y = x.currentStyle[styleProp]; else if (window.getComputedStyle) var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp); return y; } window.onload = function() { if(!document.getElementsByTagName) return; var tds = document.getElementsByTagName('td'); for(var i=0;i<tds.length;i++) { tds[i].onclick = function() { alert(this.parentNode.tagName+' = display : '+getStyle(this.parentNode,'display')+ '\n'+this.tagName+' = display : '+getStyle(this,'display')); } } } // --> </script> <!-- <script type="text/javascript"> function showHideTR(idx,vis) { var tbl,val; val = (!vis)?'none':((document.defaultCharset && !window.home)?'block': 'table-row'); if(document.getElementById && document.getElementsByTagName) { tbl = document.getElementById('tbl'); if(idx >= tbl.getElementsByTagName('tr').length) return; tbl.getElementsByTagName('tr')[idx].style.display = val; } else if(document.all && document.all.tags) { // IE4 support tbl = document.all.tbl; if(idx >= tbl.all.tags('tr').length) return; tbl.all.tags('tr')[idx].style.display = val; } } </script> --> My option tags: Quote: <form action="#" onsubmit="return false;"> <ul> <li2><label for="cb0"><input type="checkbox" id="cb0" checked="checked" onclick="showHideTR(0,this.checked);"> Blah Blah</label></li> <li2><label for="cb1"><input type="checkbox" id="cb1" checked="checked" onclick="showHideTR(1,this.checked);"> Blah Blah2</label></li> <li2><label for="cb2"><input type="checkbox" id="cb2" checked="checked" onclick="showHideTR(2,this.checked);"> Blah Blah3</label></li> <li2><label for="cb3"><input type="checkbox" id="cb1" checked="checked" onclick="showHideTR(3,this.checked);"> Blah Blah4</label></li> </ul> </form> My php page: Quote: <?php $host = "localhost"; // your host name $username = "blah blah"; // your user name to access MySql $password = "blah blah"; // your password to access MySql $database = "blah blah"; // The name of the database $no = $_POST["sureno"]; //$link = mysql_connect($host,$username,$password); if (!$link = @mysql_connect($host,$username,$password,true)) {die('Could not connect:'. mysql_error()); } @mysql_query("SET NAMES 'latin5'"); @mysql_select_db($database) or die( "Unable to select database"); $sql="SELECT * FROM blah blah WHERE sure = '$no' ORDER BY 'id'"; $result = mysql_query($sql); if (!$result) { die('Invalid query: ' . mysql_error()); } while($row=mysql_fetch_assoc($result)){ $bgcolor="#f1f1f1"; echo "<TABLE width=50% align=center cellpadding=0 cellspacing=0 id='tbl' summary='demonstration'> <tr>"; echo "<td bgcolor='dfdfdf' ><font face='arial,verdana,helvetica' color='#000000' size='3'>blah blah</font></td>"; echo "<td bgcolor='C0C0C0' ><font face='arial,verdana,helvetica' color='#FF0000' size='4'>" . $row['AB'] ."</font></td></tr>"; echo "<tr><td bgcolor='dfdfdf' ><font face='arial,verdana,helvetica' color='#000000' size='3'>blah blah</font></td>"; echo "<td bgcolor='dfdfdf'> <font face='arial,verdana,helvetica' color='#0080C0' size='2'>". $row['TR'] ."</font></td></tr>"; echo "<tr><td bgcolor='dfdfdf' ><font face='arial,verdana,helvetica' color='#000000' size='3'>blah blah</font></td>"; echo "<td bgcolor='dfdfdf' id='cb0'> <font face='arial,verdana,helvetica' color='#000000' size='3'>". $row['ML'] ."</font></td></tr>"; } mysql_free_result($result); ?> here's what I have so far Code: <html> <head> <script> MONTHS_OF_THE_YEAR = 'janfebmaraprmayjunjulaugsepoctnovdec'; MILLISECONDS_DAY = 1000*60*60*24; MILLISECONDS_YEAR = 1000*60*60*24*365.2424; LIFE_EXPECTANCY = 1000*60*60*24*365.2424*67.2; var daysArray = new Array ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); var yearBirth = ''; yearBirth = prompt('Please enter your year of birth'); var monthBirth = ''; monthBirth = prompt('Please enter your month of birth'); monthBirth = monthBirth.slice(0,3); monthBirth = monthBirth.toLowerCase(); monthBirth = MONTHS_OF_THE_YEAR.indexOf(''+monthBirth)/3; var dateBirth = ''; dateBirth = prompt('Please enter your date of birth'); var usersInputDate = new Date (yearBirth, monthBirth, dateBirth); var dd = new Date((monthBirth+1).toString() + "/" + dateBirth + "/" + yearBirth); dd=dd.getDay(); var now = new Date(); usersInputTime = (usersInputDate.getTime()); usersInputTime = parseInt(now.getTime()-usersInputTime); var ageYears = (usersInputTime/MILLISECONDS_YEAR); var ageDays = (usersInputTime/MILLISECONDS_DAY); var avgLife = (usersInputTime/LIFE_EXPECTANCY*100); document.writeln('<h1>It\'s about time...</h1>'); document.writeln('<ul>'); document.writeln('<li> </li>' </script> </head> <body> </body> </html> I need to do the following and have no idea Quote: What will be output (to the document using write())? A heading 1 title with the text It's about time... An unordered list containing appropriate wording as strings concatenated with: The weekday name for the user's birth date Use the day of the week number as an index into the weekday names array The user's age in years Present this as a fixed format number with 2 decimal places The user's age in days Present this as a fixed format number with 0 decimal places The percentage of an average life expectancy Present this as a fixed format number with 0 decimal places please help i need to get this done tonight can any one please help me out with the code. I am passing an URL for ex: www.example.com?req=23¶m=25 What i need to do is I need to remove the parameters after "?" which I did using the spilt method, Can anyone help me out now how do I send the complete URL with the parameters as hidden. what I mean is..my URL should look like www.example.com. but the second part (parameter shud be hidden). Hi I'm trying to create a javascript function that will ask a user for a character and check that character against a string containing other characters. If the character is present in the string the function should then ask the user to input another character. it should keep doing this until a charater is entered that doesnt appear in the check string. I am pretty new to javascript and have been working for about 2 days trying to get this to work. I have an assignment due next week 21.09.09 and need to get it sorted before then. Any help or pointers would be great. One stipulation that the assignment is asking for is that you have to use the indexOf method to interigate the string. I have attached the code below. Any help or pointers would be brilliant. var incorrectString = 'abcdef'; var correctString = 'ghi'; function getInput(aString) { } getInput(incorrectString + correctString); Hai everyone, I am a newbie to javascript.I have a scenario where I have two sets of textboxes,one that holds the percentage and other holds the percenteage value. Below them,I have a total value of which the percentage values will be stored. Can anyone help me in writing the javascript code in finding the percentage value of the total number given below and storing it in a text box. Any help,I need it urgent Hi Guys, I am implementing this Javascript in my summer internship. What I want to do is, 1) Show a Pop up alert with a Countdown timer( 10, 9, 8, 7 ....) after 5 minutes. 2) If user doesn't click "Ok" within the time, the page will automatically Redirect to another page. Eg- Login Page. 3) If the User clicks the "Ok" button the Page will not get re-direct. 4) Also, once the Timer countdown completes and the page redirection is done, the User when he will see the Login page will see an alert box saying. 'Your session has expired, plz login again' he clicks 'Ok' and Login again. I am very new to this Java script, but need to finish this project. Plz help me out. I want to insert image instead of those empty boxes.......can someone help me please...... <script type="text/javascript"> document.write("<html><head><title>My PhotoCollage</title></head><body>"); function makeDiv() { var r = Math.floor(Math.random()*256); var g = Math.floor(Math.random()*256); var b = Math.floor(Math.random()*256); var wh = 25 + Math.floor(Math.random()*444); var lr = (Math.random()<.5) ? "top":"right"; var bw = 1 + Math.floor(Math.random()*12); var bs = (Math.random()<.5) ? " solid":"dotted"; var dc = (Math.random()<.5) ? "Dog" : "Cat"; var Img = Math.floor(Math.random()*256); document.write("<div style=\"float: "+lr+";"+ "width: "+wh+"px;"+ "height: "+wh+"px;"+ "border: rgb(" + g + "," + b + "," + r + ") "+bw+"px "+bs+";"+ "background-color: rgb(" + r + "," + g + "," + b + ");"+ "image: "\">"+dc+ "</div>"); } var i; var count = Math.floor(Math.random()*100) + 5; for (i=0; i<count; i++) makeDiv(); document.write("</body></html>"); </script> is it possible to open all file of a folder with multiple folders inside in turn opening all files. basically i have some sites i need to fully edit but i rather work with every file from the website open i need to open every file in a folder of files in other folder help i cant go one by one it would take forever.
Hi I'm trying to download the security image from this site (at the bottom): http://pacesalsa.promotionexpert.com...2/register.jsp However, every time one refreshes the image, the image changes (obviously). So, I'm trying to figure out how to download the current image on the page to a jpg or png (or any image file type). Could someone please tell me how to do this? Thanks. I have been trying for hours to do the following: - Change the background of a div by clicking a link from another div tag. - It also needs to change back when clicked again. I know there are alot of experienced coders out there and I'm eager to learn... help would be appreciated! ===================[ URGENT ]================= confirm_state is not working properly..as it uses sajax..it is supposed to get the value of the state ..but the state being a string not working...please help.. ........................urgent......... <? function search_states($str) { //print $str; //print "<br><pre>"; $number=explode('-',$str); //print_r($number); //print $number[0]; if(count($number)==1) { $table='states'; $data=array('*'=>''); $fldarray=array("state"=>$number[0]); $val=dataSelectSearch($table,$data,$fldarray,$extra,$orderArray,$orderType); // print "<pre>"; // print_r($val); for($i=0;$i<count($val);$i++) { $state_name=$state_name."##".$val[$i]['state']; } return $state_name; } else { $strt_val=ord($number[0]); // Ascii of first character $end_val=ord($number[1]); // Ascii of last character //print chr($end_val); for($j=$strt_val;$j<=$end_val;$j++) { $table='states'; $data=array('*'=>''); $fldarray=array("state"=>chr($j)); $val=dataSelectSearch($table,$data,$fldarray,$extra,$orderArray,$orderType); for($m=0;$m<count($val);$m++) { $state_name=$state_name."##".$val[$m]['state']; } } return $state_name; } } ?> <script> function confirm_state1(msg) { // =============================== [subcategory follows ] ========================= //alert(msg); var value=msg; var arr=Array(); arr=value.split("##"); for(i=1;i<=(arr.length-1);i++) { //var new_val; //alert(i); //var int=Integer.valueOf(arr[i]); document.getElementById('innercontent').innerHTML=document.getElementById('innercontent').innerHTML+ "<br> <a href='javascript:void(0);' onclick='document.getElementById(state_name).value="+arr[i]+";' class='small_link1'>"+arr[i]+"</a>"; //document.getElementById('all_state').innerHTML=''; //alert(document.getElementById('innercontent').innerHTML); } } function showname(val) { //alert(msg1); alert(val); document.getElementById('state_name').value=val; document.getElementById('all_state').style.display='none'; } function findstate(str) { //alert(str); document.getElementById('innercontent').innerHTML=''; document.getElementById('all_state').style.display='inline'; var str1=str; x_search_states(str1,confirm_state1); } </script> I am not a JavaScript resource , on an urgent basis I need to create a GUI screen with the help javascript for running reports i.e. the parameters would be passed to reports that are to be run. My requirement is to create : User friendly drop down box A date field with calender in it so taht value can be selected from the calender and passed on to the database. A option on the GUI that would create a csv file on the server. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Get personal details</title> <!-- meta tags --> <meta name="keywords" content=""> <meta name="description" content=""> <!-- stylesheets --> <link rel="stylesheet" href="css/reset.css" type="text/css"> <link rel="stylesheet" href="css/common.css" type="text/css"> <!-- javascript --> <script src="js/jquery-1.3.2.min.js"></script> <!--conditional comments --> <!--[if IE]> <script src="js/html5.js"></script> <![endif]--> <script language="javascript" type="text/javascript"> function validName(n,c,l,d) { if(n.length == 0) { window.alert('A name must not be empty!'); return false; } if(c.length == 0) { window.alert('A country must not be empty!'); return false; } j = -1; for(i = l.length-1;i > -1;i--) { if(l[i].checked) { j = i;i = -1; } } if(j == -1) { window.alert('A like must not be empty!'); return false; } t = -1; for(s = d.length-1;s > -1;s--) { if(d[s].checked) { t = s;s = -1; } } if(t == -1) { window.alert('A dislike must not be empty!'); return false; } return true; } </script> </head> <body class="home"> <article id="page-content"> <section> <hgroup> <h2>Get personal details</h2> </hgroup> <form method="get" action="show_details.php" onSubmit="return validName(this.name.value,this.country.value,this.likes,this["dislikes[]"]);"> <table class="bordered"> <caption>Personal details form</caption> <tr> <th class="col1"> Property </th> <th class="col2"> Value </th> </tr> <tr> <td class="col1"> Name </td> <td class="col2"> <input type="text" name="name" size=30> </td> </tr> <tr> <td class="col1"> Age </td> <td class="col2"> <select name="age"> <option> 0-10 </option> <option> 11-20 </option> <option> 21-30 </option> <option> 31-40 </option> <option> 41-50 </option> <option> Over 50 </option> </select> </td> </tr> <tr> <td class="col1"> Country </td> <td class="col2"> <input type="text" name="country" size=30> </td> </tr> <tr> <td class="col1"> Likes </td> <td class="col2"> <input type="radio" name="likes" value="swimming">Swimming<br> <input type="radio" name="likes" value="running">Running<br> <input type="radio" name="likes" value="dancing">Dancing<br> <input type="radio" name="likes" value="biking">Biking<br> <input type="radio" name="likes" value="surfing">Surfing<br> </td> </tr> <tr> <td class="col1"> Dislikes </td> <td class="col2"> <!-- The value of dislikes is an array of checked values --> <input type="checkbox" name="dislikes[]" value="dogs">Dogs<br> <input type="checkbox" name="dislikes[]" value="cats">Cats<br> <input type="checkbox" name="dislikes[]" value="birds">Birds<br> <input type="checkbox" name="dislikes[]" value="fish">Fish<br> <input type="checkbox" name="dislikes[]" value="plants">Plants<br> </td> </tr> <tr> <td class="col1"> Description </td> <td class="col2"> <textarea name="description" rows=6 cols=30></textarea> </td> </tr> <tr> <td colspan=2 style="text-align: center"> <input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"> </td> </tr> </table> </form> </section> </article> </body> </html> I cant for the life of me find out why it wont display the javawindow anymore? suppose to pop up when you dont enter a name, country, check a radio or checkbox |