4

I am using Ymacs with Filepicker.io from here and i am trying to retrieve the content div using ajax.

But the problem is I can't include jQuery library too because it is resulting a conflicting and the ajax still not working i also tried this code from jQuery but it doesn't seem that it is effecting anything.

I put the no noConflict in two place.

Any ideas how to solve this problem?

<script type="text/javascript" src="/js/jquery-1.7.2.min.js">
     $.noConflict();

    window.setInterval(getAjax, 3000);

    function getAjax() {
        $.ajax({
            type: "POST",
            url: '/index',
            data: "some-data"          
        });
    }

</script>
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user1515244
  • 93
  • 1
  • 7
  • What do you mean you are trying to retrieve the content div using ajax? If you are trying to access the contents of the buffer, use `var buf = ymacs.getActiveBuffer(); var contents = buf.getCode()` – brettcvz Jul 12 '12 at 01:10

1 Answers1

1

Did you forgot a script tag or am I missing jQuery being loaded someplace else? This is working for me:

<!DOCTYPE html>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script>
  // $.noConflict();

  window.setInterval(getAjax, 3000);

  // This is getting hoisted
  function getAjax() {
        $.ajax({
            type: "POST",
            url: '/index',
            data: "some-data"
        });
  }
</script>

https://gist.github.com/3505792

user500198
  • 111
  • 1
  • 5