• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 629
  • Last Modified:

pop jqmodal on cookie disabled

Hello experts.
I m using the jqmodal (http://dev.iceburg.net/jquery/jqModal/ )
and the jcookie plugin. (http://plugins.jquery.com/files/jquery.cookie.js.txt)
If cookies are disabled i want to load via ajax a page with instructions.

The first code below is working but i need to style this with the jqmodal plugin.
I get the error:
h is undefined

 please help
1.
<script type="text/javascript" language="javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" language="javascript" src="js/jCookies.js"></script>
<script>
  jQuery(document).ready(function()
  {
    var TEST_COOKIE = 'test_cookie';
    jQuery.cookie( TEST_COOKIE, true );
    if ( jQuery.cookie ( TEST_COOKIE ) )
    {
      jQuery.cookie( TEST_COOKIE, null );  // delete the cookie
    }
    else
    {
      alert( 'blabla ');
    }
  })
</script>

2.
<script type="text/javascript" language="javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" language="javascript" src="js/jqmodal/jqmodal.js"></script>
<script type="text/javascript" language="javascript" src="js/jqmodal/jqDnR.js"></script>
<script type="text/javascript" language="javascript" src="js/jCookies.js"></script>
<link href="js/jqmodal/jqmodal.css" rel="stylesheet" type="text/css">
<script>
  jQuery(document).ready(function()
  {
    var TEST_COOKIE = 'test_cookie';
    jQuery.cookie( TEST_COOKIE, true );
    if ( jQuery.cookie ( TEST_COOKIE ) )
    {
      jQuery.cookie( TEST_COOKIE, null );  // delete the cookie
    }
    else
    {
      $('#popuppage').jqmShow({
			ajax: 'load_popup_articel.html', 
			overlay: 50,
            onShow: function(h) {
                /* callback executed when a trigger click. Show notice */
                h.w.css('opacity',1).slideDown("slow"); 
                  },
            onHide: function(h) {
                             /* callback executed on window hide. Hide notice, overlay. */
                h.w.slideUp("slow",function() { if(h.o) h.o.remove();})
				  }
			 });
    }
  })
</script>

<div class="jqmWindow" id="popuppage">
	please wait ... <img alt="loading" src="style/images/busy.gif">
 </div>

Open in new window

0
Panos
Asked:
Panos
  • 7
  • 6
1 Solution
 
Michel PlungjanIT ExpertCommented:
Where is the dialog initialised?

onShow (callback)
    Called when a dialog is to be shown. Be sure to show (set visible) the dialog.

    // onShow : show+make the window translucent
    var myOpen=function(hash){ hash.w.css('opacity',0.88).show(); };
    $('#dialog').jqm({onShow:myOpen});
0
 
PanosAuthor Commented:
Hi mplungjan.
I try to pop up the window but it is not working.Take a look please:
<script>
  jQuery(document).ready(function()
  {
    var TEST_COOKIE = 'test_cookie';
    jQuery.cookie( TEST_COOKIE, true );
    if ( jQuery.cookie ( TEST_COOKIE ) )
    {
      jQuery.cookie( TEST_COOKIE, null );  // delete the cookie
    }
    else
    {  var myOpen=function(hash){ hash.w.css('opacity',0.88).show(); };
      $('#popuppage').jqm({onShow:myOpen});
    }
  })
</script>

<div class="jqmWindow" id="popuppage">
      please wait ... <img alt="loading" src="style/images/busy.gif">
 </div>
0
 
Michel PlungjanIT ExpertCommented:
You need the function myopen too
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
PanosAuthor Commented:
mplungjan i found this solution in my net too but i'm not able to fix it myself but it is not complete there
If you can please post the full js code.I will never fix it myself.
0
 
Michel PlungjanIT ExpertCommented:
I have no idea

I could not even get this to run

http://jsfiddle.net/mplungjan/xPA3D/
0
 
PanosAuthor Commented:
mplungjan:
i think i made step forward.
in relation to this post:http://stackoverflow.com/questions/2884185/show-jqmodal-window-on-page-load
imade a little changes to my code.
I have now the popup but i cant load the ajax page.It stacks on please wait.....
jQuery(document).ready(function()
  {
    var TEST_COOKIE = 'test_cookie';
    jQuery.cookie( TEST_COOKIE, true );
    if ( jQuery.cookie ( TEST_COOKIE ) )
    {
      jQuery.cookie( TEST_COOKIE, null );  // delete the cookie
    }
    else
    {
      $('#popuppage').jqm().jqmShow({
			ajax: 'load_popup_articel.cfm', 
			overlay: 50,
            onShow: function(h) {
                /* callback executed when a trigger click. Show notice */
                h.w.css('opacity',1).slideDown("slow"); 
                  },
            onHide: function(h) {
                             /* callback executed on window hide. Hide notice, overlay. */
                h.w.slideUp("slow",function() { if(h.o) h.o.remove();})
				  }
			 });
    }
  })

Open in new window

0
 
Michel PlungjanIT ExpertCommented:
Not very clear that one HAD to do the .jqm first to initialise.

Now mine works too

http://jsfiddle.net/mplungjan/xPA3D/1/

Now the question is, does load_popup_articel.cfm load something when called from the location bar?
0
 
PanosAuthor Commented:
I made a test page that is loading nothing so that i will not have any server side problems.
Check here please with cookies disabled:
http://ierotheos.selfip.com/testcookie2.cfm
0
 
PanosAuthor Commented:
You can check now.
It was closed
0
 
Michel PlungjanIT ExpertCommented:
Whew.. That was not simple

http://jsfiddle.net/mplungjan/xPA3D/4/

Please note the url is not yours and the cookie test is reversed using !
0
 
PanosAuthor Commented:
That was perfect mplungjan.
Many many thanks!!!

A complete working SOLUTION IN NET
0
 
PanosAuthor Commented:
Thank you again.
Regards
Panos
0
 
Michel PlungjanIT ExpertCommented:
You are welcome. It was an interesting exercise.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now