jQuery Window Plugin gives "$ is not defined" error

4

I have the following problem, I found a plugin, jQuery Window , which opens windows with button to minimize, maximize, etc., and opens pages within that window, but I'm not getting it to work.

I would like to use example number 6, method 2 on my system, if anyone can give me a light on how I make a wheel like the one on the site would be great.

Remembering that I include in my HTML all necessary libraries like jQuery, jQuery UI and Plugin.

Code of the button I left to call the function and open the window when clicked

<input type='button' value='Click Here to Create Window' onclick='createWindowWithRedirectChecking2();'>

My code - Plugin

function createWindowWithRedirectChecking2(){
    $.window({
        title: "create window with redirect checking",
        url: "http://www.myspace.com",
        iframeRedirectCheckMsg: "the window is going to redirect to {url}!!\r\nPlease     select 'cancel' to stay here."
    });
}

Imports

<script src="libs/JQuery/jquery-1.11.0.min.js"></script>
<script src="libs/Bootstrap/js/bootstrap.min.js"></script>
<script src="libs/jquery-ui-1.10.4/js/jquery-ui-1.10.4.js"></script>
<script src="libs/jquery-window-5.03/jquery.window.js"></script>

<link href="libs/Bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link id="jquery_ui_theme_loader" type="text/css" href="libs/jquery-ui-1.10.4/css/black-tie/jquery-ui.css" rel="stylesheet" />
<link href="libs/jquery-window-5.03/css/jquery.window.css" rel="stylesheet" media="screen">

Code in JSFiddle: JSFiddler

    
asked by anonymous 20.05.2014 / 19:05

1 answer

5

In the tests I've done here using the code provided on the plugin page, it only works until jQuery 1.8.3. From 1.9.0 onwards to work.

It works:

<body>
    <input type="button" onclick="createWindow();" value="Crefate a window"/>
    <!-- jQuery Library -->
    <script type="text/javascript" src="//code.jquery.com/jquery-1.8.3.min.js"></script> 
    <script type="text/javascript" src="//code.jquery.com/ui/1.9.2/jquery-ui.min.js"></script> 
    <script type="text/javascript" src="js/jquery.window.js"></script>
    <script type="text/javascript">
        function createWindow() {
            $.window({
                showModal: true,
                modalOpacity: 0.5,
                icon: "http://www.google.com/favicon.ico",
                title: "Hello World!",
                content: "<h1>Hello World!</h1>",
                footerContent: "<div style='color:gray;'>this is the footer</div>"
            });
        }
    </script>
</body>

Switching to //code.jquery.com/jquery-1.9.0.min.js no longer works.

The latest plugin review is in 2011:

Last Revision: 2011-04-30

I think it's the case of looking for an alternative or using jQuery Migrate that allows use the newer versions:

<script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.js"></script>
    
20.05.2014 / 20:11