Results 1 to 4 of 4

Thread: Intellisense feature using javascript

  1. #1
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Intellisense feature using javascript

    I want to create my own intellisense feature using javascript. (i.e.) When i type letter '.',it should display in drop down box containing predefined list or array.
    The drop down should be displayed only when '.' is typed and the drop down should be visible until either one element is selected or enter is pressed.
    and the process continues.
    I tries Jquery UI autocomplete but didn't work to my expectation.
    Any idea how to achieve it.
    Thanks in advance

  2. #2
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    Here's a quick and dirty script to show you the mechanism for detecting the '.' within a text box:

    PHP Code:
    var showIntellisense = function () {
        
    alert('Intellisense Trigger Called');
    }

    $(function () {
        $(
    'input:text').change(function () {
            var 
    strContent = $(this).val()
            if (
    strContent.substr(strContent.length 1) == '.') {
                
    showIntellisense();
            }
        });
    }); 
    But, I'd ask what is this feature for? Can you give a better explanation of how it will be used, as there may be a much better way of implimenting this, such as an API that's specifically built to purpose.

  3. #3
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks ApacheTech for your reply..
    I'm trying to build an online live JavaScript editor with intellisense feature.
    I'm using codemirror,and what I want to achieve is that upon pressing '.' The user is shown the list of action and method available in JavaScript

  4. #4
    Join Date
    Sep 2016
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Mr Rktaiwala..... can u give me your email address , i wanted to discuss this project with you ??

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
  •