|
that looks OK, except if(d==document.getElementById(ItemOrder[i]).value) should use a, not i.
Keeping the approach, the code can be further improved by:
- reducing the inner loop to for(a=i+1;a<ItemOrder.length;a++) ;
- dropping the count variable
- renaming the isMoreThanTwo variable to thereAreDuplicates
something along these lines:
var thereAreDuplicates=false;
for(i=0;i<ItemOrder.length;i++) {
var d=document.getElementById(ItemOrder[i]).value;
for(a=i+1;a<ItemOrder.length;a++) {
if(d==document.getElementById(ItemOrder[a]).value) thereAreDuplicates=true;
}
if(thereAreDuplicates)break;
}
.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks Luc,
that looks pretty aswell,
Oops your first comment was just a typo when i was writing at the forum
otherwise i have it correct in my code.
|
|
|
|
|
just sum six(6) select controls , and compare with (1 + 6) * 6 / 2.
equals means ok
|
|
|
|
|
{1,1,1,6,6,6} doesn't contain duplicates?
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
|
I have download the package from http://jquery.com ,"jquery-ui-1[1].8.11.custom.zip" ,there
are too many different .js and .css files in it,and their names are analogous,i don't know
what should i include in my page.
For example, the file "demos\tabs\default.html" include follows files:
jquery.ui.all.css
jquery-1.5.1.js
jquery.ui.core.js
jquery.ui.widget.js
jquery.ui.tabs.js
demos.css
what's the function of these files??
|
|
|
|
|
Sounds as though you need to read the documentation and understand the tools before just jumping in an trying to use something.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
Hai Experts.
i am working on the slide shows for my webapplication .i need a Vertical slide Show that moves From bottom to top For Example
http://www.accenture.com/us-en/Pages/index.aspx[^]
Here they are showing in the horizontal way i need in The Reverse order Vertical with same Bttom move up and Move down
please Help me out
Regards
venu
|
|
|
|
|
|
|
|
Hi,
I want the equivalent of System.Math.Max(System.Threading.Interlocked.Increment in Javascript.I used it in my c# project and want to reuse it in JS.
ty
|
|
|
|
|
Math.max[^]
JavaScript doesn't support threading so you will not get an exact equivalent
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
what is the fonctionality of System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1);
ty
|
|
|
|
|
|
I have a web application developed with asp.net I want to print a file with extension RTF using Java script. Can anyone help me to do that?
Thanks
|
|
|
|
|
Maybe a quick look here[^] might help...
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
i used flot juery for showing chat control . I want to draw chat with a data of around 2,00,000 ( x and y axis respectively ). i am using Asp.net c# now directly return this value for separate with comma of each data. Its take too time but chart doesnt load.
if return around 5000 (double value), its working...
Have any another method to do or take 5000 data for every request upto all...
Thanks..
|
|
|
|
|
Hi All,
I am using thickbox to display my child windows. When I goto the page to be displayed in thickbox for first time, it gives me session time out(unauthorized). but if I go to same page second time (just close and reopen) it works fine!!!
@one place this issue I am facing with IE only.(on Mozilla and Safari it's working fine) and on another page it's showing error with all browsers
Please suggest me anything I am clueless.
With Thanks & Regards
Amit Sk Sharma
|
|
|
|
|
hello
my work internet computer has been blocked by fortiguard web filter and i can't access half of the websites
i don't have admin user and i cant download any progrem including programming compailers
can someone help me please?
thanks in advenced
|
|
|
|
|
I already answered this elsewher - and what does it have to do with Javascript? Face it nobody is going to help you break the law.
I must get a clever new signature for 2011.
|
|
|
|
|
These aren't the droids your are looking for.
|
|
|
|
|
Hi,
This is my first post in this forum. I am trying to learn Javascript and DHTML. I need help with the scenario mentioned below.
I have a Sharepoint in which i have some posts or announcements listed. The database is SQL Server 2005.
So is there any way to search the Sharepoint Database using a webform scripted using Client Side Scripting
or can we export the list to an external file and then use it to query the list of files in the database
Basically i am trying to setup a search engine which works intranet in office.
Any help would be appreciated.
Regards,
Subramanyam
|
|
|
|
|
This is really a SahrePoint related questin and should be posted there.
You do not directly query a SharePoint database. You would use the established SharePoint API to query data. Which API to use depends on which version of SharePoint you have. SharePoint 2010 does have a client object model that can be used from JavaScript. However, SharePoint has a very good search engine built-in. What is the problem you are trying to solve that makes you think exporting a list to an xml file is the correct course of action?
I know the language. I've read a book. - _Madmatt
|
|
|
|