dcsimg
www.webdeveloper.com
Results 1 to 9 of 9

Thread: editable content is not showing

  1. #1
    Join Date
    Feb 2015
    Posts
    20

    editable content is not showing

    Hi everyone.

    I am trying run this fiddle.
    http://jsfiddle.net/RZZ6X/9/

    it shows in the console that jquery is not defined.

    I already placed jquery as the first script to load yet it keeps showing this error. here's how I did it:

    HTML Code:
     <head>
          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    
            <title>Sports App @yield('title')</title>
    
            <script type="text/javascript" src="{{ URL::asset('js/status.js') }}"></script>
    
            <link rel="stylesheet" href="{{	elixir('css/app.css') }}"
    
        </head>
    Any Idea about how do I make it better?

  2. #2
    Join Date
    Dec 2012
    Posts
    702
    Your fiddle is OK regarding inclusion of jQuery. But what do you intend this script to do? replace() returns the string after replacement and your if checks whether that string is empty. In this case the element is emptied which has no visible effect. Please post what you intend to do.

  3. #3
    Join Date
    Feb 2015
    Posts
    20
    @Sempervivum thanks for replying.
    I moved forward with this issue; Now I have the problem that the placeholder is not showing again after I fully delete the text in the contenteditable section of the div. that's what's needs to be achieved and it would be perfect at last.

    It seems that Jquery is being loaded (I can only see it in the page source).

    I have attached updated fiddle of my existing code (css is compiled into sass but in the fiddle it's plain css and jquery code is in seperate page)

    https://jsfiddle.net/yp046e30/

    Another issue I am encountering is that when I am changing names of the div class (<div class="test"), function name of jquery ( $(".test") to $(".status") ) and also property names in css (test,mentioned 3 times) - the contenteditable box is gone. Why?

    thanks very much.

  4. #4
    Join Date
    Dec 2012
    Posts
    702
    that the placeholder is not showing again after I fully delete the text in the contenteditable section of the div. that's what's needs to be achieved and it would be perfect at last.
    The placeholder won't show again until you code it to do:
    https://jsfiddle.net/yp046e30/1/

    Another issue I am encountering is that when I am changing names of the div class (<div class="test"), function name of jquery ( $(".test") to $(".status") ) and also property names in css (test,mentioned 3 times) - the contenteditable box is gone. Why?
    I can't see any reason why this shouldn't work. I recommend posting a new fiddle for this issue.

  5. #5
    Join Date
    Feb 2015
    Posts
    20
    thanks for repying. I find something odd:
    The browser I was checking this page is Firefox. It did not returned placeholder after deleting text with both empty method and element.text("How's your fitness going?..."); you suggested.
    And then I was checking the page with Chrome broswer and both methods worked perfectly! (placeholder has been shown again after text delete)
    Can you explain that difference? is there any idea about how can I make it working also in Firefox?

    Here's the fiddle for the name changing ( I replaced the name 'test' with 'status'):

    https://jsfiddle.net/v4qL77e1/

    I swear I don't know what's wrong. It does work in the fiddle as well with the name 'status' but not in the app.

  6. #6
    Join Date
    Dec 2012
    Posts
    702
    You are right, your fiddle is working fine. Unfortunately I'm using Opera and Firefox is not working for me. Maybe someone else can assist you.

  7. #7
    Join Date
    Feb 2015
    Posts
    20
    No problem. Thanks for your time.

  8. #8
    Join Date
    Feb 2016
    Posts
    1
    Regards, I enjoy this.

    http://www.kidsjunction-store.com/

  9. #9
    Join Date
    Oct 2013
    Posts
    1,410
    "placeholder" is not a valid attribute for <div>. One possible explanation for the spotty behavior.
    In dog beers I've only had one.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles