|
same code, commented:
function m(a, f)
{
var ret = [];
for (var i=0; i<a.length; ++i)
{
var val = f(a[i]);
if ( val != null )
ret.push(val);
}
return ret;
}
var els = document.getElementsByTagName("*");
var ids = m(els, function(el)
{
return el.id?el.id:null;
});
every night, i kneel at the foot of my bed and thank the Great Overseeing Politicians for protecting my freedoms by reducing their number, as if they were deer in a state park. -- C hris L osinger, Online Poker Players?
|
|
|
|
|
iam very thnks mr Shog9
but your code is note work as my need
the code
var els = document.getElementsByTagName("*");
is return the object
i do the follwing
alert(els)// the retuern of this alert is object
and then replace it with
alert(els.id)//this convert return undefind value what is the problem with this
and then
when calling the function m(a,f)
id do this code
function m(a, f)
{
var ret = [];
alert(a.length)//its return the wrong number of element in my page
for (var i=0; i<a.length; ++i)
="" {
="" var="" val="f(a[i]);
" alert(a[i])="" this="" alert="" return="" undefind="" what="" is="" nr="" shong
="" if="" (="" !="null" )
="" ret.push(val);
="" }
="" ret;
}
and="" the="" code=""
var="" ids="m(els," function(el)=""
="" {=""
alert(el);="" itis=""
="" id="" it="" exists,="" otherwise="" null="" to="" exclude="" element.
="" el.id?el.id:null;
="" });
mr="" shon="" pls="" you="" have="" any="" as="" sampel="" and="" can="" give="" me=""
pls="" send=""
thnks="" your="" hellp=""
<div="" class="ForumSig">Thaer
|
|
|
|
|
Thaer Hamael wrote: i do the follwing
alert(els)// the retuern of this alert is object
and then replace it with
alert(els.id)//this convert return undefind value what is the problem with this
els is an array of elements. Some - but not all - of those elements have id attributes. The array itself is not an element, nor does it have an id attribute.
Thaer Hamael wrote: alert(a.length)//its return the wrong number of element in my page
That's a bold assertion. Do you have an example that demonstrates this? If so, you should send it on to the company responsible for the browser you're testing in, as you've likely found a bug with their implementation of getElementsByTagName() .
Thaer Hamael wrote: alert(a[i])//this alert return undefind
Again, do you have a concrete example of this?
Thaer Hamael wrote: Mr Shon pls if you have any code as sampel and if you can give me it
I did. I've posted it twice now. If it doesn't work for you, then you need to come up with a reason why.
every night, i kneel at the foot of my bed and thank the Great Overseeing Politicians for protecting my freedoms by reducing their number, as if they were deer in a state park. -- C hris L osinger, Online Poker Players?
|
|
|
|
|
Hi,
I'm using AJAX.
I have a textbox and a button inside an updatepanel.
I have textboxtext changed event for the textbox and a click event for the button.
When I input a text inside the textbox without removing the cursor inside it
then click the button, and perform debug, only the textchange event gets executed,
while it doesn't execute code inside click event.
Please help. I can't simply force call click event inside textchange event of my textbox.
Thank you.
Gerri
|
|
|
|
|
CandyMe wrote: I'm using AJAX.
You're using ASP.NET AJAX - so you might get better answers by posting in the ASP.NET forum (no guarantees though...)
CandyMe wrote: I have a textbox and a button inside an updatepanel.
The focus change (and thus, the textchange event) happens before the click, so that's what you'll get first. You might want to re-think your strategy a bit - why would you need a text change event when there's a perfectly good button to let you know when the user's done?
every night, i kneel at the foot of my bed and thank the Great Overseeing Politicians for protecting my freedoms by reducing their number, as if they were deer in a state park. -- C hris L osinger, Online Poker Players?
|
|
|
|
|
It's because I have a customvalidation. I would like to prompt the user of invalid input without having to click the button yet. I have other controls in the form as well.
Thank you.
Gerri
|
|
|
|
|
I have Password and Re-type Password fields.
If the user inputs a password that is less than 6 characters, the user is prompted with a RegExValidator "Minimum of 6 characters."
And if the user inputs a password in Re-Type password that DOESN'T MATCH WITH INVALID PASSWORD, the user is prompted with a CompareValidator "Passwords don't match."
Can I disable the "Passwords don't match" comparevalidator and only prompt it if the user has already ENTERED A VALID PASSWORD in Password field?
Thank you.
-- modified at 9:45 Thursday 25th October, 2007
Gerri
|
|
|
|
|
I'm not sure what is wrong with your current setup. If the user inputs different values in the 2 password input boxes, surely it is correct to notify them that the passwords don't match? This logic still applies if the user enters an invalid password in the first box and a valid password in the second box. The passwords don't match, so it is OK to flag this up.
Paul Marfleet
|
|
|
|
|
|
Hi .,
I have webservices method which takes parameter byte[]
this byte[] parameter is compressed Dataset at client-side ,
Now I am Decompressing this at the server side .
All this Compressing and decompressing is done to shrink the size of
dataset , but now the Server pop's the error memory consumption excedded.
Now, do I have any other way to compress Dataset and sent over Webservices?
I did googled this problem but was enable to sort out the problem.
Thanks
Navneet.H
Develop2Program & Program2Develop
|
|
|
|
|
Navneet Hegde wrote: do I have any other way to compress Dataset
Other than what? You haven't even said what method it is that you have tried.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Hi .,
Yea,
--The client sends the request as --
<br />
<br />
byte[] Dataset2Byte;<br />
Dataset2Byte = CompressDataSet(DSet);<br />
MyService Service = new MyService.Service<br />
Service.UpdateTableData(Dataset2Byte ,tablename)<br />
<br />
public byte[] CompressDataSet(DataSet ds)<br />
{<br />
try<br />
{<br />
BinaryFormatter bnformat = new BinaryFormatter();<br />
using (MemoryStream memstream = new MemoryStream())<br />
{<br />
bnformat.Serialize(memstream, ds);<br />
byte[] bs = memstream.GetBuffer();<br />
<br />
MemoryStream output = new MemoryStream();<br />
GZipStream ZipIt = new GZipStream(output, CompressionMode.Compress, true);<br />
<br />
ZipIt.Write(bs, 0, bs.Length);<br />
ZipIt.Close();<br />
<br />
return output.ToArray();<br />
}<br />
}<br />
catch (ApplicationException ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
return null;<br />
}<br />
<br />
}
--- This is at server side webservice -----
<br />
public bool UpdateTableData(byte[] byteSet, string TableName)<br />
{<br />
}<br />
<br />
private DataSet Decompress(byte[] ds)<br />
{<br />
try<br />
{<br />
MemoryStream input = new MemoryStream();<br />
input.Write(ds, 0, ds.Length);<br />
input.Position = 0;<br />
<br />
GZipStream Unzipit = new GZipStream(input, 0, true);<br />
MemoryStream output = new MemoryStream();<br />
<br />
byte[] bf = new Byte[4096]; { }<br />
int read = 1;<br />
read = Unzipit.Read(bf, 0, bf.Length);<br />
while (read > 0)<br />
{<br />
output.Write(bf, 0, read);<br />
read = Unzipit.Read(bf, 0, bf.Length);<br />
}<br />
Unzipit.Close();<br />
byte[] result = output.ToArray();<br />
<br />
BinaryFormatter bnformat = new BinaryFormatter();<br />
using (MemoryStream mStream = new MemoryStream(result))<br />
{<br />
return (DataSet)bnformat.Deserialize(mStream);<br />
}<br />
<br />
}<br />
catch (Exception ex)<br />
{<br />
throw ex;<br />
}<br />
}
This throws the Error : memory consumption excedded
and on server Application Event Log you read recycled mmemory consumption exceeded 60% (267MB of RAM)
Now if I write this byteset to File it is of size 6MB.
Respect
Navneet.H
Develop2Program & Program2Develop
|
|
|
|
|
Navneet Hegde wrote: byte[] bs = memstream.GetBuffer();
The GetBuffer method gives you the underlying array that the MemoryStream is using, including unused space. Use the ToArray method to create an array that only contains the used data.
Navneet Hegde wrote: MemoryStream input = new MemoryStream();
input.Write(ds, 0, ds.Length);
input.Position = 0;
Just do:
MemoryStream input = new MemoryStream(ds);
Navneet Hegde wrote: GZipStream Unzipit = new GZipStream(input, 0, true);
Have you verified that CompressionMode.Decompress actually has the value 0?
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Hi Guffa.,
The problem for uploading huge dataset is solved for now atleast , I mean for the max dataset table having records 160000 having columns 70.
What I tried is
1) Dataset.RemotingFormat = SerializationFormat.Binary;
2) I used deflateAlgorithm instead of Gzip
Thanks
Navneet.H
Develop2Program & Program2Develop
|
|
|
|
|
in my css file i have specified the style elements for select as :
SELECT
{
font-family: Arial, Helvetica, sans-serif;
color: #000000;
height:100%;
width: 100%;
background-color: #ffffff;
font-size: 12px;
}
but in my web page i want that height should not be set so that i can use the size attribute of select tag. I also cannot change the css either.How can i ovverride it.
thanks in advance
|
|
|
|
|
You can specify a new height in your HTML code:
<br />
<select style="height:auto;" .....<br />
Wout Louwers
|
|
|
|
|
thanks buddy for ur help......it's working fine.....
|
|
|
|
|
I have just started working with Ajax.its very intersting,but i dont have much information about Ajax can any one have good and easy study material if you can send me at abhi.chouksey@gmail.com i am thank full to them
abhishek
-- modified at 1:45 Wednesday 24th October, 2007
|
|
|
|
|
A good book to buy is called AJAX in Action, from Manning, I believe.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Dear every one, i am new to development. my boss has asked to prepare a useful presentation that
WHAT FRAMEWORKS CAN WE ADOPT FOR OUR OWN DEVELOPMENT?
help me plz to let me know that which one is the best and why.
thanks
|
|
|
|
|
So, why did you name your post 'PHP' ?
There are multiple frameworks for a variety of reasons, and more than one survives for various reasons. IMO, ASP.NET is plainly the best, but platforms like PHP have their adherents, and even classic ASP survives, probably more because of people who refuse to upgrade their skill set than any possible advantage they could have.
However, if your presentation to your boss will consist of replies you got from online forums, then either you lied to get your job, or your boss is really stretching to ask you for such a presentation.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
I'm using the IE7 browser,I use the window.close to close the browser. Below is my sample code
strscript = " { window.opener=top;window.close();}"
Me.ClientScript.RegisterStartupScript(Me.GetType(), "closescript", strscript)
How can i remove the confirmation message on IE7? Any idea or suggetion
Thanks
|
|
|
|
|
You cannot remove that message. Its that simple.
Wout Louwers
|
|
|
|
|
You should be able to remove the dialog if you set the window.opener=self
Now if you are talking about having multiple tabs open, I am not sure what can be done with that dialog.
Ben
|
|
|
|
|
On http://www.asp.net/ajax/showcase/ when you hover over a showcased site a window will popup giving more detail about the site. What control is providing this functionality and where can I find a sample.
Thank you,
|
|
|
|