...

View Full Version : Urgent...I can't use jQuery JavaScript Library v1.5 and jQuery 1.2.3 min?



ankifreeze
02-16-2011, 11:36 AM
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

$(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

$.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');
}
});

VIPStephan
02-16-2011, 11:46 AM
I don’t quite understand why both versions are needed but anyway, try the noconflict (http://api.jquery.com/jQuery.noConflict/) mode.

ankifreeze
02-16-2011, 12:22 PM
I donít quite understand why both versions are needed but anyway, try the noconflict (http://api.jquery.com/jQuery.noConflict/) mode.
I have just tried jQuery.noConflict(); or change $ into var j = jQuery.noConflict();...but still doesn't work...

venegal
02-16-2011, 04:53 PM
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.

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.

ankifreeze
02-17-2011, 01:05 AM
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.

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

$.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');
}
});

venegal
02-17-2011, 01:39 AM
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.

ankifreeze
02-17-2011, 02:35 AM
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...
$.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

<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............

oesxyl
02-17-2011, 04:50 PM
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...
$.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

<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

ankifreeze
02-18-2011, 01:53 AM
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...

ankifreeze
02-18-2011, 09:41 AM
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......

ankifreeze
02-18-2011, 12:57 PM
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....

venegal
02-18-2011, 05:09 PM
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.



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.

VIPStephan
02-18-2011, 05:45 PM
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.

oesxyl
02-18-2011, 05:49 PM
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

venegal
02-18-2011, 06:54 PM
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.

Kor
02-18-2011, 06:58 PM
My oh my...:rolleyes: 2 days to solve a JQuery conflict. In 2 days I would have written the whole code in native JavaScript... :D

ankifreeze
02-19-2011, 12:09 AM
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.




If you only knew how much comedic potential that sentence you just said there has.

Anyway, if you're happy, I'm happy.
this doesn't need write html structure like these
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title of the document</title>
</head>

<body>
The content of the document......
</body>

</html>


I already said those are just my remains pf my experiment....I usually make experiment don't need care about another element that have no relation of my experiment.....

like <html><body> and I usually did'nt close html or body tag (</html>)

anyway thanks for help me....

VIPStephan
02-19-2011, 01:57 AM
I usually make experiment don't need care about another element that have no relation of my experiment.....

Well, the irony of your statement is that sometimes things like unclosed elements do have a relation to anything you experiment with. First rule of web development (or any programming related task, if I may say): You canít expect proper results from invalid code. For example if you have no doctype the page may display significantly different than with a proper doctype. If you donít close elements then this will result in nesting errors and Ė depending on the capabilities of the browsers to handle code errors Ė in erroneous display of your experiment.

So, keep this in mind: Always make sure your code is standards compliant and error free! Every experiment has to be well prepared. Why do a bad job if you can do a good job?

ankifreeze
02-19-2011, 02:23 AM
Well, the irony of your statement is that sometimes things like unclosed elements do have a relation to anything you experiment with. First rule of web development (or any programming related task, if I may say): You canít expect proper results from invalid code. For example if you have no doctype the page may display significantly different than with a proper doctype. If you donít close elements then this will result in nesting errors and Ė depending on the capabilities of the browsers to handle code errors Ė in erroneous display of your experiment.

So, keep this in mind: Always make sure your code is standards compliant and error free! Every experiment has to be well prepared. Why do a bad job if you can do a good job?
thanks for advice...I'll try do my best..:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum