Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Alerts

  1. #1
    Join Date
    Jan 2008
    Posts
    40
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Alerts

    I'm preparing a new website. During the preview period I would like to put up a welcome Alert message. I found this bit of JavaScript elsewhere:

    HTML Code:
    <script language="Javascript">
    
    <!--
    // please keep these lines on when you copy the source
    // made by: Nicolas - http://www.javascript-page.com
    
    alert ("This is a Javascript Alert")
    //-->
    
    </script>
    However this routine doesn't let me put line returns into my text and it includes the current URL in bold as the headline, not what I'd prefer. You can preview it here (although the site is still crude). I'd prefer an alert that's a bit nicer. Any recommendations?

    Appreciated.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    Alerts do that in some browsers. You could try a DHTML pop up:

    http://www.dynamicdrive.com/dynamici...ndow/index.htm

    or just put something right on the page that says:

    "Under Construction"
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    wanapitei (02-22-2008)

  4. #3
    Join Date
    Jan 2008
    Posts
    40
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    Alerts do that in some browsers. You could try a DHTML pop up:

    http://www.dynamicdrive.com/dynamici...ndow/index.htm
    Something's wrong. Followed the same procedures I successfully did with Omnislide. Moved the CSS and JS files into their appropriate locations in the media directory (media/css/dhtmlwindow.css, and media/js/dhtmlwindow.js).

    Made this edit to the demo file:

    HTML Code:
    <link rel="stylesheet" href="../media/css/dhtmlwindow.css" type="text/css" />
    
    <script type="text/javascript" src="../media/js/dhtmlwindow.js"></script>
    This addressing approach works fine with Omnislide but not for Dhtml Window on my Mac. Therefore I switch to absolute addressing and put the demo on my website and place the css and js files in the appropriate media folders. Thus:

    HTML Code:
    <link rel="stylesheet" href="http://www.morleychalmers/MostlyTheravada/media/css/dhtmlwindow.css" type="text/css" />
    
    <script type="text/javascript" src="http://www.morleychalmers/MostlyTheravada/media/js/dhtmlwindow.js"></script>
    Still doesn't work. I'm probably missing something obvious but I can't see it. Anyone spot the issue?

    Appreciated.

  5. #4
    Join Date
    Dec 2007
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    You missed the top level domain (.com / .net / .org / whatever you have) and your script cannot be loaded.
    And why do you put it in another file? Users' browsers will need to do an extra request - that's not good. You better place the JavaScript code right into the HTML page, in <script> container, and CSS in the header of the page, in <style> container, and everything will load and run on a single page. Faster and no errors

  6. The Following User Says Thank You to Boxer For This Useful Post:

    wanapitei (02-22-2008)

  7. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    That's true, and unlike with omnislide, there is also code you need to put on your page for this script. Refer to Stage 2 on the demo page.

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. The Following User Says Thank You to jscheuer1 For This Useful Post:

    wanapitei (02-21-2008)

  9. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I was unsure whether to laugh or cry at the attempt to put a credit notice on a single alert() statement...
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey View Post
    I was unsure whether to laugh or cry at the attempt to put a credit notice on a single alert() statement...
    LOL, I didn't even notice that!
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  11. #8
    Join Date
    Jan 2008
    Posts
    40
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    That's true, and unlike with omnislide, there is also code you need to put on your page for this script. Refer to Stage 2 on the demo page.
    I got fooled by the demo file working just fine "right out of the box". Oddly, by just changing the location of where to find the supporting CSS and JS files, it broke.

    Quote Originally Posted by jscheuer1 View Post
    Please post a link to the page on your site that contains the problematic code so we can check it out.
    There indeed was a URL to a demo, now removed. Here's the new, now revised demo, with a different set of issues.

    I'm using the ajax option here, pointing to the previewAlert file on my site. However the CSS code in this file is being ignored for some reason. Not only are the margin calls ignored, so is the type point size. I'm missing something here.

    Also, on this Mac the Minimize and Close widget images are coming up as "image ?", which is odd in that the widgets appear just fine on this Mac when going to DHTML Window.

    Thanks for pointing out this Alert utility, much better than the other one.

  12. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    Paths (like to images or links) on a page imported via AJAX will be relative to the page that imports it (the 'top' page), not to the imported page - if there is any doubt, use the absolute path. With css, the link to the css should be put on and set relative to the 'top' page, if it is a style section, not a link - it should be on the 'top' page. Paths in the css style declarations (if any - like for background images) should be relative to (if external) that css file. If it is a style section, as I say it should be on the 'top' page, and its paths will be relative to that 'top' page. Once again, use absolute paths whenever in doubt.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  13. The Following User Says Thank You to jscheuer1 For This Useful Post:

    wanapitei (02-22-2008)

  14. #10
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    Code:
    <script type="text/javascript">
    <!--
    //This copyright notice is copyrighted under the terms stated here.//
    -->
    </script>
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •