|
Thank you for the reply... !!
But i cant edit the css file or the source code...
I have to use ID or classname and execute the code. The second option is not valid anymore. Can u please provide a solution using the ID. Do we have a way for it?
|
|
|
|
|
So what are you allowed to to then, wave a magic wand?
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Hi Manfred,
I am executing this piece of Javascript on a Content Editor web part of Sharepoint 2010.
modified 9-May-13 6:54am.
|
|
|
|
|
AshwiniRS wrote: I have to use ID or classname and execute the code.
You originally said you can't use the classname so that option is out. Since this is a part of table you can't really use an ID because columns are tied to rows which gives the idea of having an unknown count leading to unknown ID's.
you can maybe do a partial ID name search and hide everything that way.
$('td[id*=partialname]').hide();
Maybe if you give some more example of what your problem looks like using http://jsfiddle.net/[^] we can help further.
Best of luck.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
You absolutely must have a way of identifying the columns to hide though. IF there is no identifying characteristic to allow you to separate the columns to hide from the columns to show, you can't do this. Period.
|
|
|
|
|
One could use the index of the TD, then get all the other TD elements at that index, and hide each of them. Sure, that's not a CSS selector to identify the column, but it's a way to identify the column.
|
|
|
|
|
Sure yeah, ANY method of identifying those columns could work. It doesn't have to be a class, but there has to be something.
|
|
|
|
|
|
Hi Friends,
How can i export a html table into excel by client side script
|
|
|
|
|
|
I have function readInt() this need a protocol-buffers[^] library and makes the following:
override public function readInt() : int
{
return decodeZigZag32(this.readRawVarint32());
}
I must translate the function in delphi.
description:
decodeZigZag32(int n)[^]
readRawVarint32()[^]
javacode:
public int readRawVarint32() throws IOException {
byte tmp = readRawByte();
if (tmp >= 0) {
return tmp;
}
int result = tmp & 0x7f;
if ((tmp = readRawByte()) >= 0) {
result |= tmp << 7;
} else {
result |= (tmp & 0x7f) << 7;
if ((tmp = readRawByte()) >= 0) {
result |= tmp << 14;
} else {
result |= (tmp & 0x7f) << 14;
if ((tmp = readRawByte()) >= 0) {
result |= tmp << 21;
} else {
result |= (tmp & 0x7f) << 21;
result |= (tmp = readRawByte()) << 28;
if (tmp < 0) {
for (int i = 0; i < 5; i++) {
if (readRawByte() >= 0) {
return result;
}
}
throw InvalidProtocolBufferException.malformedVarint();
}
}
}
}
return result;
}
ActionScript code:
public function readRawVarint32() : int
{
var _loc_3:int = 0;
var _loc_1:* = this.readByte();
if (_loc_1 >= 0)
{
return _loc_1;
}
var _loc_2:* = _loc_1 & 127;
var _loc_4:* = this.readByte();
_loc_1 = this.readByte();
if (_loc_4 >= 0)
{
_loc_2 = _loc_2 | _loc_1 << 7;
}
else
{
_loc_2 = _loc_2 | (_loc_1 & 127) << 7;
var _loc_4:* = this.readByte();
_loc_1 = this.readByte();
if (_loc_4 >= 0)
{
_loc_2 = _loc_2 | _loc_1 << 14;
}
else
{
_loc_2 = _loc_2 | (_loc_1 & 127) << 14;
var _loc_4:* = this.readByte();
_loc_1 = this.readByte();
if (_loc_4 >= 0)
{
_loc_2 = _loc_2 | _loc_1 << 21;
}
else
{
_loc_2 = _loc_2 | (_loc_1 & 127) << 21;
var _loc_4:* = this.readByte();
_loc_1 = this.readByte();
_loc_2 = _loc_2 | _loc_4 << 28;
if (_loc_1 < 0)
{
_loc_3 = 0;
while (_loc_3 < 5)
{
if (this.readByte() >= 0)
{
return _loc_2;
}
_loc_3++;
}
throw new IllegalArgumentException();
}
}
}
}
return _loc_2;
}
are they identical?
public static function decodeZigZag32(param1:int) : int
{ return param1 >>> 1 ^ -(param1 & 1);
}
who can help me?
|
|
|
|
|
Thanks, I have found the solution
|
|
|
|
|
Hi all,
I am trying to pass the value inside of "this.id" from one function to another function but it's not working. Basically I am trying to grab the id of a thumbnail image which is inside anchor tags, by using "this.id" when they are clicked. Then I would like to display data related to the clicked thumbnail which are stored in an array, using innerHTML. I am using the AddEventListener property inside the script tags to listen for the onclick event thus I do not have the onclick property on my webpage. The following are my functions inside the script tags:
var songTitle =new Array("Title1", "Title2");
function AddListeners()
{
if(window.addEventListener)
{
document.getElementById('A1').AddEventListener("click",Display_Info,false);
document.getElementById('A2').AddEventListener("click",Display_Info,false);
document.getElementById('A3').AddEventListener("click",Display_Info,false);
}
else if(window.attachEvent)
{
document.getElementById('A1').attachEvent("onclick",Display_Info);
document.getElementById('A2').attachEvent("onclick",Display_Info);
document.getElementById('A3').attachEvent("onclick",Display_Info);
}
}
function imgClicked(x)
{
var idClicked = x;
var newID = idClicked.substring(0,1);
var convertedID = ParseInt(newID,10);
return convertedID;
}
function Display_Info()
{
var A= this.id;
var picID = imgClicked(A);
document.getElementById('Title').innerHTML= songName[picID];
}
The following are anchor tags inside the body of my webpage:
<a href="#self"><img src=image1" id="A0"></a>
<a href="#self"><img src=image2" id="A1"></a>
<a href="#self"><img src=image3" id="A2"></a>
Please take a look to see why my script is not working. Any help is greatly appreciated, thanks in advance.
|
|
|
|
|
.id is a property of html element (html DOM), not of a function
this is the pointer of an instance like html element inside of html DOM.
document.getElementById('A1').AddEventListener("click",Display_Info,false);
--> this is the pointer of document.getElementById('A1')
param of Display_Info is not exists like pointer or id-string-value
|
|
|
|
|
Hi, thanks for replying. I understand that id is a property of DOM element but I've seen tutorials where "this.id" is used to get the id of an element that is clicked. Because I am using the AddEventListener property, I did not use the
onclick="Dispay_Info();" in my webpage.
|
|
|
|
|
FYI all your anchor tags src= have no opening double-quotes
|
|
|
|
|
Hello
Considering to this teaching
http://translate.google.com/translate?hl=fa&sl=fa&tl=en&u=http%3A%2F%2Fwww.srco.ir%2FArticles%2FDocView.asp%3FId%3D558
Good on my test asp answered.
We exchanged html page when I code 2
<pre lang="Javascript">onclick="sendRequest('2.html?id=1')"</pre>
<pre lang="Javascript"><div id="d1">
</div>
<script type="text/javascript">
var q = location.search.substring(1).split('=');
if (q[1] > 0) {
document.getElementById('d1').innerHTML = "اطلاعات شما ثبت شد";
}
else {
document.getElementById('d1').innerHTML = "خطا در ثبت اطلاعات";
}
</script></pre>
If the output is
<pre lang="Javascript"><div id="d1">
</div>
<script type="text/javascript">
var q = location.search.substring(1).split('=');
if (q[1] > 0) {
document.getElementById('d1').innerHTML = "اطلاعات شما ثبت شد";
}
else {
document.getElementById('d1').innerHTML = "خطا در ثبت اطلاعات";
}
</script></pre>
How much to take
هـر جا چراغی روشنه از ترس تنها بودنه ای ترس تنهایی من ، اینجا چراغی روشنه
|
|
|
|
|
Your question is not clear. English please.
|
|
|
|
|
2 page html
page 1 > 1.html
<pre lang="HTML"><html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<meta http-equiv="Content-Language" content="fa">
<title>New Page 1</title>
<script type="text/javascript">
var xmlHttp = null;
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert('استفاده ممکن نیست'); } }
function sendRequest(url) {
if (xmlHttp) {
xmlHttp.open("POST", url, true); // "GET", "POST", "HEAD"
xmlHttp.onreadystatechange = onCallback;
xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xmlHttp.send(null);
}
}
function onCallback() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200 || xmlHttp.status == 304) {
document.getElementById('results').innerHTML = xmlHttp.responseText;
}
else {
alert('Error: ' + xmlHttp.status);
}
}
}
</script>
</head>
<body style="font-family: Tahoma;">
<input type="button" value="Show" onclick="sendRequest('2.html?id=1')" />
<br />
<div id="results">
</div>
</body>
</html></pre>
---------------
page 2 > 2.html
<pre lang="HTML"><div id="d1">
</div>
<script type="text/javascript">
var q = location.search.substring(1).split('=');
var x = document.getElementById('d1');
if (q[1] > 0) {
x.innerHTML = "oki";
}
else {
x.innerHTML = "no";
}
</script>
</pre>
-------------------------------------------------------------------
Output in the
onclick="sendRequest('2.aspx?id=0')"
results >
<pre lang="HTML"><div id="d1">
</div>
<script type="text/javascript">
var q = location.search.substring(1).split('=');
var x = document.getElementById('d1');
if (q[1] > 0) {
x.innerHTML = "oki";
}
else {
x.innerHTML = "no";
}
</script>
</pre>
x.innerHTML = "oki"; or no??
هـر جا چراغی روشنه از ترس تنها بودنه ای ترس تنهایی من ، اینجا چراغی روشنه
|
|
|
|
|
|
Why do you consider this a question?
The link is error 404 anyhow.
|
|
|
|
|
I must be in a hurry ... not sure how the links messed up and how it ended up here instead of the lounge... I'll remove it from here
|
|
|
|
|
can't remove, but corrected the link anyways.
|
|
|
|
|
|
Hi,
i have one link, if I will click on that it will open one video on different page. before loading this video into separate page i want to display loading image/progress bar.
My problem is i am using code because of which i am not able to match the time taken to load the video..
$('#dvLoading').fadeOut(2000);
some time it is taking more that 2000 or sometime taking less time..
Note: i m using javascript to display video on page using:
swfobject.embedSWF(playerUrl, "richMediaPlayer", playerWidth, playerHeight, "9.0.0", "expressInstall.swf", flashvars, params, attributes);
please help me its urgent to me...
Thanks in advance
|
|
|
|