Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-16-2011, 11:36 AM   PM User | #1
ankifreeze
New Coder

 
Join Date: Dec 2010
Posts: 62
Thanks: 2
Thanked 0 Times in 0 Posts
ankifreeze is an unknown quantity at this point
Urgent...I can't use jQuery JavaScript Library v1.5 and jQuery 1.2.3 min?

hello....urgent...I have to finish my project this week....I have to use JavaScript Library v1.5 and jQuery 1.2.3.... but when I use them in same time,my script doesn't work.....I make chatnox like facebook...I use JavaScript Library v1.5 for make pop up window and I use jQuery 1.2.3. to post message....when I didn't use jQuery 1.2.3. I can open window but can't post message....when I didn't use JavaScript Library v1.5 I can post but I can't open new window for chat.....I can't use another method beside this ... any suggestion?


I use this jquery to post
Code:
$(document).ready(function() {


	$('#myForm').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);setInterval(this,2000);document.myForm.reset();
			}
		})
		return false;
	})
})
and I use this jquery to make pop up window
Code:
$.window({
   title: "complext window",
   content: $("#window_block5").html(), 
   x: 150,               
   y: 100,              
   width: 600,           
   height: 300,          
   minWidth: 200,        
   minHeight: 100,      
   maxWidth: 700,        
   maxHeight: 400,       
   scrollable: false,   
   onOpen: function(wnd) { 
      alert('open');
   },
   onShow: function(wnd) {  
      alert('show');
   },
   onClose: function(wnd) { 
      alert('close');
   },
   onSelect: function(wnd) {
      log('select');
   },
   onUnselect: function(wnd) { 
      log('unelect');
   },
   onDrag: function(wnd) { 
      log('drag');
   },
   afterDrag: function(wnd) { 
      log('after dragged');
   },
   onResize: function(wnd) { 
      log('resize');
   },
   afterResize: function(wnd) { 
      log('after resized');
   },
   onMinimize: function(wnd) { 
      log('minimize');
   },
   afterMinimize: function(wnd) { 
      log('after minimized');
   },
   onMaximize: function(wnd) { 
      log('maximize');
   },
   afterMaximize: function(wnd) { 
      log('after maximized');
   },
   onCascade: function(wnd) { 
      log('cascade');
   },
   afterCascade: function(wnd) { 
      log('after cascaded');
   }
});

Last edited by ankifreeze; 02-16-2011 at 11:45 AM..
ankifreeze is offline   Reply With Quote
Old 02-16-2011, 11:46 AM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,599
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
I don’t quite understand why both versions are needed but anyway, try the noconflict mode.
__________________
Don’t click this link!
VIPStephan is online now   Reply With Quote
Old 02-16-2011, 12:22 PM   PM User | #3
ankifreeze
New Coder

 
Join Date: Dec 2010
Posts: 62
Thanks: 2
Thanked 0 Times in 0 Posts
ankifreeze is an unknown quantity at this point
Quote:
Originally Posted by VIPStephan View Post
I don’t quite understand why both versions are needed but anyway, try the noconflict mode.
I have just tried jQuery.noConflict(); or change $ into var j = jQuery.noConflict();...but still doesn't work...
ankifreeze is offline   Reply With Quote
Old 02-16-2011, 04:53 PM   PM User | #4
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
There is never a reason for using two different versions of jQuery on the same page, so just get rid of the older one.

jQuery.noConflict doesn't make sense in this situation either, because it's not just about the "$" alias — you are actually trying to define two "jQuery" objects.

Edit: And if it doesn't work, you have to show your whole code. I have no idea how (or where) you are trying to include jQuery.

Last edited by venegal; 02-16-2011 at 04:55 PM..
venegal is offline   Reply With Quote
Old 02-17-2011, 01:05 AM   PM User | #5
ankifreeze
New Coder

 
Join Date: Dec 2010
Posts: 62
Thanks: 2
Thanked 0 Times in 0 Posts
ankifreeze is an unknown quantity at this point
Quote:
Originally Posted by venegal View Post
There is never a reason for using two different versions of jQuery on the same page, so just get rid of the older one.

jQuery.noConflict doesn't make sense in this situation either, because it's not just about the "$" alias — you are actually trying to define two "jQuery" objects.

Edit: And if it doesn't work, you have to show your whole code. I have no idea how (or where) you are trying to include jQuery.
yes,I think so...I have find another way...I will not using jquery 1.2.3.min...but can you suggest me what should I do in order I can post using ajax or jquery...here is my site link http://makingmoney-formula.com/sample.php

I include input form into footer content in window
Code:
$.window({
   title: "chating",
   content: $("#windowchat").html(), 
   footerContent:"<form id='myForm' method='POST' action='ajaxform2.php'><input type='text' size='30' name='text'><form>",
   x: 150,               
center
   y: 100,               
 center
   width: 600,          
   height: 300,          
   minWidth: 200,       
   minHeight: 100,     
   maxWidth: 700,        
   maxHeight: 400,      
   scrollable: false,    
   onOpen: function(wnd) {  
into body
      alert('open');
   },
   onShow: function(wnd) { 
 display routine is finished
      alert('show');
   },
   onClose: function(wnd) { 
button
      alert('close');
   },
   onSelect: function(wnd) { 
window
      log('select');
   },
   onUnselect: function(wnd) { 
      log('unelect');
   },
   onDrag: function(wnd) {
 drag
      log('drag');
   },
   afterDrag: function(wnd) { 
      log('after dragged');
   },
   onResize: function(wnd) { 
 resize
      log('resize');
   },
   afterResize: function(wnd) { 
      log('after resized');
   },
   onMinimize: function(wnd) { 
 minimize
      log('minimize');
   },
   afterMinimize: function(wnd) { 
minimized
      log('after minimized');
   },
   onMaximize: function(wnd) { 
 to maximize
      log('maximize');
   },
   afterMaximize: function(wnd) { 
 maximized
      log('after maximized');
   },
   onCascade: function(wnd) { 
 cascade
      log('cascade');
   },
   afterCascade: function(wnd) { 
 cascaded
      log('after cascaded');
   }
});
ankifreeze is offline   Reply With Quote
Old 02-17-2011, 01:39 AM   PM User | #6
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
Ok, the most tangible error is that you try to set up the form's submit event before the form is even there. The form gets added to the DOM when the button is clicked, and only after that can you successfully add the event handler.

Once you will have changed that, the form won't be submitted normally any more, and instead your code will be run. That's when you will start to get errors from your debugger, because, seriously, your whole code is a mess.

The thing you linked to isn't even an HTML page, it's just a bunch of tags that look like they have been thrown together by a madman.

And what about that page "chat3.php" that you are loading into that iframe? You still try to include several versions of jQuery there, then you nonchalantly call jQuery.noConflict(), as if to calm down those silly jQuerys that so defiantly refuse to work together. Then you use the "$" alias as if nothing happened.

I can't deny that all of that is somewhat amusing, but the best advice I can give you is to learn the basics and go back to the drawing board.
venegal is offline   Reply With Quote
Old 02-17-2011, 02:35 AM   PM User | #7
ankifreeze
New Coder

 
Join Date: Dec 2010
Posts: 62
Thanks: 2
Thanked 0 Times in 0 Posts
ankifreeze is an unknown quantity at this point
Quote:
Originally Posted by venegal View Post
Ok, the most tangible error is that you try to set up the form's submit event before the form is even there. The form gets added to the DOM when the button is clicked, and only after that can you successfully add the event handler.

Once you will have changed that, the form won't be submitted normally any more, and instead your code will be run. That's when you will start to get errors from your debugger, because, seriously, your whole code is a mess.

The thing you linked to isn't even an HTML page, it's just a bunch of tags that look like they have been thrown together by a madman.

And what about that page "chat3.php" that you are loading into that iframe? You still try to include several versions of jQuery there, then you nonchalantly call jQuery.noConflict(), as if to calm down those silly jQuerys that so defiantly refuse to work together. Then you use the "$" alias as if nothing happened.

I can't deny that all of that is somewhat amusing, but the best advice I can give you is to learn the basics and go back to the drawing board.
first you wrong about html page...I use code below(chat3.php) to retrieve data from database and setinterval in order data is always updated...
Code:
$.window({
   title: "chating",
   url: "chat3.php, 
   footerContent:"<form><input></form",

yes, i think so...its's so mess....i can understand all you have said.....it window only can be used for static content/html....
like this
Code:
<script> function(){$.window({
   title: "chating",
   content: $("#windowchat").html(), 
   footerContent:"<div> this is footer</div>"});})</script>

<div id="windowchat"><p>  * Website Builder- Build a website that is     Professional & Stunning with SiteCube Site Builder</p></div>
okay I'm new in jquery...but if there is way how can I include form into footercontent and make it work like using ajax or jquery? or should I set.URL in order I can inlude more jquery and php to DOM and it will works after button clicked? if that's more crazy I will not linking to another page more like chat3.php and another pages..... and where I can learn basic about jquery window that? I have searched in google about that but I don't find............

Last edited by ankifreeze; 02-17-2011 at 02:56 AM..
ankifreeze is offline   Reply With Quote
Old 02-17-2011, 04:50 PM   PM User | #8
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by ankifreeze View Post
first you wrong about html page...I use code below(chat3.php) to retrieve data from database and setinterval in order data is always updated...
Code:
$.window({
   title: "chating",
   url: "chat3.php, 
   footerContent:"<form><input></form",

yes, i think so...its's so mess....i can understand all you have said.....it window only can be used for static content/html....
like this
Code:
<script> function(){$.window({
   title: "chating",
   content: $("#windowchat").html(), 
   footerContent:"<div> this is footer</div>"});})</script>

<div id="windowchat"><p>  * Website Builder- Build a website that is     Professional & Stunning with SiteCube Site Builder</p></div>
okay I'm new in jquery...but if there is way how can I include form into footercontent and make it work like using ajax or jquery? or should I set.URL in order I can inlude more jquery and php to DOM and it will works after button clicked? if that's more crazy I will not linking to another page more like chat3.php and another pages..... and where I can learn basic about jquery window that? I have searched in google about that but I don't find............
the simplest thing you can do is to change the code which use jquery 1.2.3 to work with 1.5 and forget about noconflict. Probably you have a problem in code since don't work with 1.5 and trying to use noconflict will not work anyway.

best regards
oesxyl is offline   Reply With Quote
Old 02-18-2011, 01:53 AM   PM User | #9
ankifreeze
New Coder

 
Join Date: Dec 2010
Posts: 62
Thanks: 2
Thanked 0 Times in 0 Posts
ankifreeze is an unknown quantity at this point
Quote:
Originally Posted by oesxyl View Post
the simplest thing you can do is to change the code which use jquery 1.2.3 to work with 1.5 and forget about noconflict. Probably you have a problem in code since don't work with 1.5 and trying to use noconflict will not work anyway.

best regards
yes..agree with you ....I'm searching another code now.... but I think the main problem is how can I include URL or include jquery or php to footerContent....

you can see on two links below
first
http://makingmoney-formula.com/sample.php

second
http://makingmoney-formula.com/sample1.php

in first link I include form into footercontent...
in second link, retrieve and post is succes but it can't be used... remove footercontent using showfooter:false then I include form into chat3.php and I give limit to retrieve from database but It's so bad because I can't make scroller, i want first link like this...

Last edited by ankifreeze; 02-18-2011 at 01:55 AM..
ankifreeze is offline   Reply With Quote
Old 02-18-2011, 09:41 AM   PM User | #10
ankifreeze
New Coder

 
Join Date: Dec 2010
Posts: 62
Thanks: 2
Thanked 0 Times in 0 Posts
ankifreeze is an unknown quantity at this point
Quote:
Originally Posted by venegal View Post
Ok, the most tangible error is that you try to set up the form's submit event before the form is even there. The form gets added to the DOM when the button is clicked, and only after that can you successfully add the event handler.

Once you will have changed that, the form won't be submitted normally any more, and instead your code will be run. That's when you will start to get errors from your debugger, because, seriously, your whole code is a mess.

The thing you linked to isn't even an HTML page, it's just a bunch of tags that look like they have been thrown together by a madman.

And what about that page "chat3.php" that you are loading into that iframe? You still try to include several versions of jQuery there, then you nonchalantly call jQuery.noConflict(), as if to calm down those silly jQuerys that so defiantly refuse to work together. Then you use the "$" alias as if nothing happened.

I can't deny that all of that is somewhat amusing, but the best advice I can give you is to learn the basics and go back to the drawing board.
I forgot...i want to clarify that you have said about bunch of tags....bunch of tag you see through debugger is remains of my experiment before I'll made this chatbox and these have no relation of my problem......

Last edited by ankifreeze; 02-18-2011 at 09:53 AM..
ankifreeze is offline   Reply With Quote
Old 02-18-2011, 12:57 PM   PM User | #11
ankifreeze
New Coder

 
Join Date: Dec 2010
Posts: 62
Thanks: 2
Thanked 0 Times in 0 Posts
ankifreeze is an unknown quantity at this point
wow...finally I can resolve my problem......it's so easy....just include <frame src="....."> into footercontent.....I think I don't need go back to drawing board....

Last edited by ankifreeze; 02-18-2011 at 01:00 PM..
ankifreeze is offline   Reply With Quote
Old 02-18-2011, 05:09 PM   PM User | #12
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
Quote:
Originally Posted by ankifreeze View Post
I forgot...i want to clarify that you have said about bunch of tags....bunch of tag you see through debugger is remains of my experiment before I'll made this chatbox and these have no relation of my problem......
What I meant was that a HTML page is supposed to have a certain structure, with a doctype, a <html> tag, a <head> and a <body>, and the thing you produced there had none of that.


Quote:
Originally Posted by ankifreeze View Post
wow...finally I can resolve my problem......it's so easy....just include <frame src="....."> into footercontent.....I think I don't need go back to drawing board....
If you only knew how much comedic potential that sentence you just said there has.

Anyway, if you're happy, I'm happy.
venegal is offline   Reply With Quote
Old 02-18-2011, 05:45 PM   PM User | #13
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,599
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Quote:
Originally Posted by venegal View Post
There is never a reason for using two different versions of jQuery on the same page, so just get rid of the older one.
Well, to be honest, I’m just sitting over such a case. Old CMS with implementation of jQuery 1.2.6 and I still have to use some plugins of which I can’t find old versions that work with that version of jQuery. While one could modify the CMS core it’s not within my power and therefore the easiest solution is to use two versions of jQuery.

However, in doing so one must remove the entire jQuery namespace by passing true to the noConflict function. This also means that one has to adapt the plugin code to convert all occurrences of the Dollar function or reference to jQuery to the new name (which includes the call of (jQuery); at the end of those scripts).
After all, if you create an application from scratch (i. e. if you have control over everything), of course, it’s the best to use the latest version and to not mix old plugins with new ones.
__________________
Don’t click this link!
VIPStephan is online now   Reply With Quote
Old 02-18-2011, 05:49 PM   PM User | #14
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by VIPStephan View Post
Well, to be honest, I’m just sitting over such a case. Old CMS with implementation of jQuery 1.2.6 and I still have to use some plugins of which I can’t find old versions that work with that version of jQuery. While one could modify the CMS core it’s not within my power and therefore the easiest solution is to use two versions of jQuery.
same problem with wordpress for example, but i gues Venegal was talking about the case when you write the code, as in op case,

best regards
oesxyl is offline   Reply With Quote
Old 02-18-2011, 06:54 PM   PM User | #15
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
If you have to work with legacy code, you sometimes have to be creative, I can see that. In my experience, though, jQuery is quite serious about backwards compatibility and doesn't haphazardly make API changes, and if there are changes, they are very well documented.

So, I guess if I had to change that plugin anyway, so it reflects the new namespace I'm giving to the legacy jQuery version, I could as well just dig in and fix it up. There's no denying that loading up different frameworks for different plugins is something that should be avoided, and so is loading several versions of the same framework (but that's no news to any of us).

Btw, I wasn't aware of removing the whole namespace with noConflict, so thanks for that. But I really hope I will never dig myself into a hole so deep that I would have to resort to actually using that.

Oh, and as a side note: If the plugin authors had any clue what they were doing, it would totally suffice to change the "jQuery" parameter, which is passed to the anonymous containing function, to the new namespace — the "$" within that closure could stay the way they were.
venegal is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:16 PM.


Advertisement
Log in to turn off these ads.