|
My answer is yes to all your questions. Removing unnecessary characters from javascript is known as minification and it does improve performance (I myself noticed this in one of my projects). Hence by the same logic removing comments will also improve performance.
Also this is one of the suggest best-practices by Yahoo.
|
|
|
|
|
I want to add browse for folder control in my web page.In HTML,browsing to the file level is there.But I need to browse the folder & want to get the complete path of that folder in web page.This folder can be in my local PC or can be in other pc in the network.Is this possible with java script or any other language???
I have to implement this feature anyhow.So any help is appreciated.If there is a solution in other languages like java,VC++ ,then please let me know.
Thanks in advance..
|
|
|
|
|
I don't believe there is a solution to this. The browser is of course using the capabilities of the client system and the default is for the FileOpen dialog, not the Folder dialog. To correct this you would need to install something on the client machine, very unlikely, or at the least use an ActiveX control, which is unlikely to be allowed either.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
new AjaxUpload("#fuCondition", {
action: servicesPath + 'Handlers/FileUpload.ashx?t=0&BRH_ID='+ $("#BRH_ID").val()+"&USR_ID="+ $("#USR_ID").val()+"&DeedOffice="+ $("#DeedOf").val(),
name: 'userfile',
data: {},
autoSubmit: true,
responseType: false,
onChange: function (file, extension) {
$("#fuCondition").hide();
$("#Uploading").show();
},
onSubmit: function (file, extension) {
if (!(extension && /^(rtf|zip)$/.test(extension))) {
alert('Error: file type not allowed.');
return false;
}
this.disable();
},
onComplete: function (file, response) {
$('#file_name').val(file);
if (response.toLowerCase() != 'true') {
$('#status').hide();
setTimeout(3000, 6000);
$("#Uploading").hide();
$("#fuCondition").show();
}
else if (response.toLowerCase() == 'false')
$('#status').html('error!, file not saved');
else
$("#status").html(response);
}
});
How to set the autosubmit to false, so that the plugin dsnt take defualt values of textbox? some links will be cool
modified on Thursday, April 21, 2011 8:42 AM
|
|
|
|
|
Please edit your post and format your code snippets using the "code block" toolbar item.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I have a textbox on my aspx page and a search button.
When I enter text in textbox and press search it populates the results in a jquery modal and on selection of one of the values returns me the data which gets mapped to various controls on the aspx page.
My issue is how do I send the textbox values to the service? I tried using on text_chnaged where I call the service and load the data into grid and on click of the button i call the div to open.
But this requires two clicks and is not a neat solution.. as every time i click the searhc button it loads an empy window and on next click opens a window with the populated grid.
please can you suggest how to overcome this. which even to be used load the data from service from
also how to enable paging in jquery grid.
|
|
|
|
|
Can you please provide snippet of code to GetData from web service and NextButton click to show window?
Thanks,
Imdadhusen
sunaSaRa Imdadhusen
+91 99095 44184
|
|
|
|
|
Hi,
I have a dropdown list populated with the list of names on my aspx page. I want to use this as a data source for autocomplete in the name textbox. Which is the best way to do it in jquery?!
Thanks,
|
|
|
|
|
|
I 've tried the following:
<script type ="text/javascript">
$(document).ready(function() {
var a = $("input#names").val();
$("#tags").autocomplete({
url: "CodeFile1.cs\SearchNames",
data: $("input#names").val()
});
});
</script>
<div class="ui-widget">
<label for="names">Names: </label>
<input id="names" />
</div>
and my codefile is :
public string[] SearchNames(string Name)
{
string [] Names = null;
int i;
i = 0;
ServiceClient serviceClient = new ServiceClient();
SearchResponse searchResponse = new SearchResponse();
principalSearchResponse = bondInformationServiceClient.SearchPrincipals(principalSearchRequest);
foreach (Name name in SearchResponse.NameList)
{
Names [i] = name .nameField.ToString().Trim();
i++;
}
}
return Names ;
}
gives me an runtime error: object expected.
|
|
|
|
|
I think you read the documentation on the autocomplete plugin wrong. If you wish to use an Url to load the autocomplete data from, which for as far as I've been able to figure out by your sample code you are, then you should return a plain text response with one possible word per line. And keep in mind it performs a round trip to the server, which means you will need to create a script file on the server (JSP, PHP, ASPX).
Look at http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions[^]
The documentation indicates the call to the server will contain the word to autocomplete in a parameter called 'q'.
|
|
|
|
|
Thanks Gerben, I read it again and understood what u mean!!..
I was just wondering if it's possible to use a wcf with it?
Also since this wcf is being used extensively and returns an object which is a list<objectnames>
thanks,
|
|
|
|
|
hi guys,
i have six(6) select controls all with values 1-6.
when i click submit in javascript i would like to check that a
select's value has not already been selected by the other five (5) selects.
can anyone please help me how i can do this, i have tried logic after logic
and yet still no joy at all...please help me.
i tried:
var ordercntr = false;
var partial = '';
var orderfinal = new Array();
for (l = 0; l < order.length; l++) {
partial += order[l] + '~';
var d = document.getElementById(order[l]).value;
if (partial.search(d) < 1)
{
orderfinal[l] = d; ordercntr = true;
}
else
{
ordercntr = false; break;
}
}
The logic works like a charm if the selected values in the selects are in the order 1-6
But fails badly if lets say the second(2) select has the value 5(or something else other than 2)
i know i have to revisit the entire logic but i have tried and now i'm asking
for help before i try forever.
I will appreciate any help.
Morgs
|
|
|
|
|
there are several ways to do this. here are a few:
1.
compare 2 with 1; then 3 with 1 and 2; then...
2.
create a bit mask where each bit corresponds to a value (bit1=value 1, bit2=value 2, bit3= value 3,...); start at zero, then OR with the bit value, in pseudo-code bitmask=bitmask | (1<<value) and finally check the final value is what it should be: 0x7E
3.
similar to #2, use a bit mask; before ORing in a new bit, check the bit is still zero; if it isn't, there is a duplicate.
4.
same as #2 or #3, however use a string instead of a bit mask.
5.
same as #2, however use an array, have it sorted, then compare with what it should be.
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.
|
|
|
|
|
Hi Luc,
Thanks for your suggestion, i found dodgy solution though.
1. I put all my selects ids in an array (e.g. ItemOrder)
2. i loop through the ItemOrder likse so;;
var count=0;
var isMoreThanTwo=false;
for(i=0;i<ItemOrder.length;i++)
{
var d=document.getElementById(ItemOrder[i]).value;
for(a=0;a<ItemOrder.length;a++)
{
if(d==document.getElementById(ItemOrder[i]).value)
{
count++;
}
if(count>1){isMoreThanTwo=true;break;}
}
if(isMoreThanTwo)break;
}
if(count<=1)
{
}
else
{
}
The above works like a charm, might not be the best solution but does just the trick
Thanks,
Morgs
|
|
|
|
|
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
|
|
|
|
|