Jump to content

Webworldx

Members
  • Posts

    347
  • Joined

  • Last visited

Everything posted by Webworldx

  1. Not quite sure what you mean? Do you just want it printing the other way around? Or do you want it printing the ".,.," too?
  2. You should find any new browser supports it fine, it's just the older ones like the previous explorer mac's that have problems with it.
  3. We do not create entire codes for people on demand. Post how far you've got with the code and we can help you complete it.
  4. You'd have a paragraph of plain text like: Then you'd use a javascript code to cycle through each word in the text, check if it was one of your ad "keywords", if so, underline it and add a code sayonmouseover="show_advert(this)";with your function creating a floating div that hovers near your word with the advert inside.Obviously that's a fully javascript solution, mostly the first bit of the ads code will be done by the server, with just the show_advert function done client side.
  5. Yes, your code is just saying "if the button is on the page... carry out... "i'm guessing you've got some button on the page with code:... onclick="PopWindow()" .... You need something more like this:... onclick="PopWindow(1)" ...on the first button, and:... onclick="PopWindow(2)" ... on the second. Then your function code would look like: function PopWindow( num ) { if (num == 1) { window.open("itempage01.html", "myWindow", "status=1, height=450, width=550, resizable=0"); } else if (num == 2) { window.open("itempage02.html", "myWindow", "status=1, height=450, width=550, resizable=0"); } else { }}
  6. Inline.. could be an iframe or just directly written on the page with JS/html.Layer... like the old Geocities ones, or like the above, but layered on the page with a DIVPopup... pops up a new window / tab on the browser with the contentPopunder... loads a new window / tab in the browser but does NOT navigate directly to it. Users see the advert usually after leaving your siteInterstitial.. Loads an ad between the first page and the page the user clicks. DeviantArt does it a lot, as do flash games and download sites.In-text ads... when words on a page are underlined, and hovering over them provides advertising contentLink ads... just the usual click here to see my site
  7. You don't really want to be doing this in Javascript, try PHP or ASP (server side scripting) instead.
  8. Webworldx

    reverse()

    Not quite sure what you mean? <script>var myArray = [];myArray[0] = "something0";myArray[1] = "something1";myArray[2] = "something2";myArray[3] = "something3";myArray[4] = "something4";myArray[5] = "something5";myArray[6] = "something6";myArray[7] = "something7";myArray[8] = "something8";myArray[9] = "something9";myArray[10] = "something10";myArray[11] = "something11";myArray[12] = "something12";myArray[13] = "something13";myArray[14] = "something14";myArray[15] = "something15";myArray[16] = "something16";myArray[17] = "something17";myArray[18] = "something18";myArray[19] = "something19";myArray[20] = "something20";myArray[21] = "something21";myArray = myArray.reverse();for(i in myArray){ document.write (myArray[i] + "<br />");}</script> Reverses it fine for me...?Edit: yes, that would have been your problem
  9. If you've got the choice, go for id. Then you can use the relatively simple:document.getElementById('Object_ID');to access it.
  10. You'd want the ! inside the bracket if(!variable_that_doesnt_exist){ ....do something when it cant find it} Why not just switch the math operators around though? < left and > fmRight, and use an || instead of &&?
  11. No need for an array, but i'm unsure on what you mean by "button A". Is it a command button on the page? Or are you talking about the A key on the keyboard? Either is possible very simply =)
  12. I have no idea what the lines are in the middle, but if you're just looking to take a string, and write it and its reverse on a line, then remove a character from it, and repeat writing it and its reverse until you have one character, then... <script type='text/javascript'>/*Normal & Reverse PrintCreated by Webworldxhttp://w3schools.com*/var myString = "Hello"function reverse_print_remove(txt){ if(txt.length == 0) return false; document.write( txt + " " ); document.write( txt.split("").reverse().join("") ); document.write( "<br />" ); txt = txt.substring(0,txt.length-1); reverse_print_remove(txt);}reverse_print_remove(myString);</script> Note you'll have to know how that works, and if it's part of your homework, you'll want to rewrite it for yourself or attribute it appropriately.
  13. Actually, if you're going to use that, i'd add an extra match statement and return false before carrying out the split just in case the variable isn't there, but apart from that.
  14. you'd need the .split('&')[0] on the end of that, but yes, I'd probably end up using something like: function get_content( vari ){ var newReg = new RegExp( vari + "=" , "i"); return location.href.split( newReg )[1].split("&")[0]}var retr = get_content("var");
  15. Webworldx

    Loop

    What kind of thing are you looking to loop?You can loop through all the letters of the alphabet using something like: <html><body><script type='text/javascript'>for(i=0;i<26;i++){ document.write( String.fromCharCode( 65 + i ) );}</script></body></html> If that's helpful to you. 65 is the keycode for upper case A, you can also loop through the lcase from 97.
  16. Webworldx

    ADDing

    Are they both numbers?a1=Math.floor(document.newp.amt.value);a2=Math.floor(document.newp.otheramt.value);total=(a1+a2);
  17. If you're calling a timeout to a function within itself, it's always handy to use setInterval itself - I find it a lot cleaner code.But as yours works, I don't think we should complain too much
  18. Unless of course you input it all by hand in javascript like: var people = []people[0] = [ "Mark" , "May 28" ]people[1] = [ "Chris" , "June 1" ].... etc, but as aspnetguy said, server side would be much much easier, and better.
  19. <html><BODY ONLOAD="jsClock24hr()"><FORM NAME="clockForm24hr"><FONT face="Times New Roman,Normal " size=3><script type="text/javascript">document.write("Local time: ")var d=new Date()var weekday=new Array("Sunday","Monday","Tuesday","Wednsday","Thursday","Friday","Saturday")var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec")document.write(weekday[d.getDay()] + " ")document.write(d.getDate() + ". ")document.write(monthname[d.getMonth()] + " ")document.write(d.getFullYear())</script><script Language="JavaScript"><!-- hide from old browsersfunction jsClock24hr(){var time = new Date()var hour = time.getHours()var minute = time.getMinutes()var second = time.getSeconds()var temp = "" + ((hour < 10) ? "0" : "") + hourtemp += ((minute < 10) ? ":0" : ":") + minutetemp += ((second < 10) ? ":0" : ":") + seconddocument.getElementById('digits').innerText=tempid = setTimeout("jsClock24hr()",1000)}//--></SCRIPT></head><span name = f id = digits>Loadings</span></FONT></FORM></body></html>
  20. If the client has very low browser permissions, then yes you can use the file system object - but in 99.9% of cases you won't have access to this.Why would you want to create a folder?
  21. You've asked for two interesting ideas - but we don't just write the full code for you here sorry.Show us how far you've got with the coding, and we will point you in the right direction
  22. Hi Life In Binary - most Javascript nasties have been caught by browsers and antivirus software nowadays, but there's always scope with every new version and extensions added that a vulnerability will pop up.Good luck with the site though. If you really want to force users to have Javascript on, you could build the whole site with it - and just show a noscript message otherwise. Horrible for text browsers, worse on your search engine rankings - but it's a thought
  23. You'd have to create the calendar yourself from scratch in javascript (it's quite fun if you want to give it a go).With the time, do validation on key down, create a variable with the string and the letter pressed include it and see if it validates correctly. If not, cancel the key down. You could just use drop down boxes though and save yourself the trouble?
  24. You want something like: <script type='text/javascript'>var Months = new Array();Months[0] = [ "January2_100x76.gif" , "Tagline here for January" ];Months[1] = [ "February2_100x76.gif" , "Tagline here for the month" ];Months[2] = [ "March2_100x76.gif" , "Tagline here for the month" ];Months[3] = [ "April2_100x76.gif" , "Tagline here for the month" ];//....Months[10] = [ "November2_100x76.gif" , "Tagline here for the month" ];Months[11] = [ "December2_100x76.gif" , "Tagline here for the month" ];var iMonth = new Date().getMonth()if(iMonth <= Months.length){ document.write( "<img src='" + Months[iMonth][0] + "' width='100' height='76' alt='" + Months[iMonth][1] + "' />")}</script> ... dropped in where the image would normally be on the page.Why aren't you doing it server side though? Seems pointless sending that code to every browser every page, when PHP could sort it out for you? Also, if a user sets a different date on their computer, they'll see a different month's message (obviously)
  25. Hi there,The site layout isn't centered, so on larger screens it's stuck on the left with a huge gap on the right.The site is very simple - which is fine, but from the front page it doesn't look like a store or "front window" for a store which i'm guessing it's what it's trying to be?Other than that, It looks good I'm sure other people will comment though. As you put this in the Javascript forum, were you looking for more critique on the scripting of the site rather than the layout and looks?
×
×
  • Create New...