Dialog open and close problem

Dialog open and close problem

Hi all and Jack,

I simplified and minimized my previous question.
I have a button on my page like that:
  1. <a href="{{ URL::route('category/action', array($category->id)) }} "class="newWindow"><img src="{{ asset('img/green_button.png') }}" /></a>
And a dialog div:
  1.     <div id="diyalog">There is a dialog here.      
        </div>


Finally an event:
  1. $(document).ready(function(){
        $('.newWindow').click(function (event){

            event.preventDefault();
            $('#diyalog').dialog();

            $("#diyalog").dialog("close");
           
        });
    });









When I clicked the button, there is the following error (I see it debug mod):
  1. TypeError: $(...).dialog is not a function

    $('#diyalog').dialog();
$("#diyalog").dialog("close"); doesn't work at all.

How can I resolve that? Thanks.

Note: Upon reading some comments I tried some conflict commands, I renamed my jquery version etc.