Results 1 to 8 of 8

Thread: Require javascript for online help chat box

  1. #1
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Require javascript for online help chat box

    Hi All,

    I require javascript for a online help chat box, moving across a page from left to right or vice versa as soon as site is opened through Url.

    This chat box should have an option to close the box if not required..

    I would request you to help me the earliest , as i'm in need to implement the same..Thanking you all in advance.


    Regards,
    Ramya

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    We'd need to see your code for we have no clue how your box is being called. If it is an element, you would use something like this.
    Code:
    <script type="text/javascript">
    var close = function(el){
    el.style.display = "none";
    }
    </script>
    Then to close it you could do something like this:
    Code:
    <button onClick="close(document.getElementById('myDiv'));>X</button>
    Last edited by Nile; 10-22-2008 at 09:11 PM.
    Jeremy | jfein.net

  3. #3
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    It be better you use <input type="button"> instead of <button>. Your first suggestion would not be save nor should it work. It also be best you use a semi-colon at the end of a js variable. The correct syntax is:

    Code:
    <script type="text/javascript">
    <!--
    var close = function (el){
    document.getElementById(el).style.display = "none";
    };
    //-->
    </script>
    -magicyte
    Last edited by magicyte; 10-23-2008 at 03:32 AM.

  4. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    magicyte, your comment on JS is erroneous:
    Code:
    <script type="text/javascript">
    <!--
    var close = function (el){
    document.getElementById(el).style.display = "none";
    };
    //-->
    </script>
    For further reading:
    http://www.linuxtopia.org/online_boo...q/hidingjs.htm
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  5. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Magic, if I'm getting the element when calling it, I shouldn't not then neeed to call it again.
    Jeremy | jfein.net

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

    Default

    However, the <!-- and --> there generally shouldn't be used, since they will hide the script entirely from the browser under XHTML. Every browser that can't execute Javascript at least knows enough to ignore it, since about a decade ago. magicyte, you should get into the habit of indenting your code properly.

    As for the rest of your chat box, Ramya, it depends on what server-side technologies you have at your disposal. This cannot be implemented entirely client-side: there must be at least a small server-side component.
    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!

  7. #7
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi All,


    Thanks for your reply... I have no experience in coding except for doing minor modifications...
    I have an example site which have the chat box, how I prefer..
    No idea if i could post that link here....
    I have such an idea to implement for a website.
    If i could get in touch through personal id's for further discussion, it would be helpful.

    Aswell need a help for serverside scripting too.

    Thanks
    Ramya

  8. #8
    Join Date
    Oct 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    See, my code here:

    http://www.freewarefiles.com/program_5_53_23396.html

    Easy AJAX / PHP Chat.

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
  •