|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
HOW TO REPLACE '<' with any other character in Javascript.
for example
Baskar
to
bhtml> Baskar b/html> like this
please help me out it is urgent;)
www
|
|
|
|
|
Use the replace method of the string object:
var s = '<html>Baskar</html>';<br />
var s2 = s.replace(/</g, 'b');
---
b { font-weight: normal; }
|
|
|
|
|
I'm tring to make Animated div textboxes using the litle OOP that javascript has but ending up with some dead ends.
Yeah I have no clue what I'm doing went it comes to OOP with javascript
Any hints on what I could do to make a box like this in OOP us jscript?
It's easy to do when it's not animated, don't even need OOP.
Only reason I need OOP when animted is to keep track of the box being
open and closed to animate for each height of each box, but since
not sure how to do the OOP using jscript, it's behaving weird.
LIVE DEMO NOT ANIMATED
http://cdmlb.homelinux.net/sites/wip/projects/prog_script/javascript/text_block/text_block.html
LIVE DEMO ANIMATED NOT WORING TO WELL PLAY AROUND WITH EACH BOX A FEW TIMES
THE CODE ON THIS PAGE IS THE OOP VERSION< BUT FOR THE DEMO TRIED TO DO IT WITH NO OOP, BECAUSE OOP SUCKS WITH JSCRIPT
http://cdmlb.homelinux.net/sites/wip/projects/prog_script/javascript/anim_text_block/anim_text_block.html
HTML
<br />
<div id="main1" class="main"><br />
<div id="header1" class="header"><br />
<a href="javascript:block1.DisplayBlock;" class="title">CLICK HERE TO OPEN AND CLOSE<⁄a><br />
<⁄div><br />
<div id="body1" class="body"><br />
<p id="content1" class="content"><br />
SOME TEXT GOES HERE.<br />
<⁄p><br />
<⁄div><br />
<div id="footer1" class="footer"><br />
<⁄div><br />
<⁄div><br />
CSS
<br />
.main<br />
{<br />
border: blue thin outset;<br />
width: 430px;<br />
}<br />
<br />
.header<br />
{<br />
border: white thin outset;<br />
background-color: Blue;<br />
text-align: left;<br />
padding: 5px;<br />
color: White;<br />
}<br />
<br />
.title<br />
{<br />
color: White;<br />
}<br />
<br />
.body<br />
{<br />
border: white thin inset;<br />
padding: 0px;<br />
height: 0px;<br />
}<br />
<br />
.content<br />
{<br />
display: none;<br />
text-align: justify;<br />
}<br />
<br />
.footer<br />
{<br />
border: white thin outset;<br />
background-color: Blue;<br />
text-align: right;<br />
padding: 5px;<br />
}<br />
JAVASCRIPT
<br />
var block1 = new AnimBlock("body1", "content1", 200);<br />
<br />
function AnimBlock(body, content, speed)<br />
{<br />
this.body = body;<br />
this.content = content;<br />
this.speed = speed;<br />
this.size = 1;<br />
<br />
AnimBlock.prototype.DisplayBlock = function()<br />
{ <br />
if(this.document.getElementById(this.content).style.display == "block")<br />
{<br />
this.document.getElementById(this.content).style.display = "none";<br />
this.document.getElementById(this.body).style.padding = "0px";<br />
this.CloseBlock();<br />
<br />
this.size = 1;<br />
}<br />
else<br />
{<br />
this.OpenBlock();<br />
this.document.getElementById(this.body).style.padding = "20px";<br />
this.document.getElementById(this.content).style.display = "block";<br />
}<br />
}<br />
<br />
AnimBlock.prototype.OpenBlock = function()<br />
{<br />
this.document.getElementById(this.body).style.height = this.size+"px";<br />
this.size += 5;<br />
setTimeout(function(){OpenBlock();}, this.speed);<br />
}<br />
<br />
AnimBlock.prototype.CloseBlock = function()<br />
{<br />
this.document.getElementById(this.body).style.height = this.size+"px"<br />
this.size -= 5;<br />
<br />
setTimeout(function(){CloseBlock();}, this.speed);<br />
}<br />
}<br />
cdmlb
|
|
|
|
|
No one not even going to look at it thanks?
cdmlb
|
|
|
|
|
A couple quick notes (don't have time to look it over properly just now):
cdmlb@hotmail.com wrote: AnimBlock.prototype.DisplayBlock = function()
Since you're adding this function to the prototype, you really don't need to do it every time an object of that type is instantiated. You can put all those outside of the constructor function and it'll work just fine.
cdmlb@hotmail.com wrote: if(this.document.getElementById(this.content).style.display == "block")
You never assign anything to this.document , so it doesn't exist. In your demo page, the functions are not called as part of an object, and so this is actually a reference to the default scope, which does include document (though prefixing it with this is redundant).
cdmlb@hotmail.com wrote: setTimeout(function(){CloseBlock();}, this.speed);
}
There's no exit condition - you need to stop calling CloseBlock() at some point...
OOP in JS is easy enough, but you can't think about it the same way you do OOP in most other languages.
|
|
|
|
|
yeah I know if have to put an if statment at some time for the open and close functions
just took them out for not until I can get the oop part of it working first
cdmlb
|
|
|
|
|
I think I got the OOP working better now, but I'm dumb and can't get it to animate any comments?
<br />
block1 = new AnimBlock("body1", "content1", 200);<br />
block2 = new AnimBlock("body2", "content2", 200);<br />
block3 = new AnimBlock("body3", "content3", 200);<br />
<br />
AnimBlock.prototype.DisplayBlock = DisplayBlock;<br />
AnimBlock.prototype.OpenBlock = OpenBlock;<br />
AnimBlock.prototype.CloseBlock = CloseBlock;<br />
<br />
function AnimBlock(body, content, speed)<br />
{<br />
this.body = body;<br />
this.content = content;<br />
this.speed = speed;<br />
this.size = 0;<br />
}<br />
<br />
function DisplayBlock()<br />
{ <br />
if(document.getElementById(this.content).style.display == "block")<br />
{<br />
document.getElementById(this.body).style.height = "0px";<br />
document.getElementById(this.body).style.padding = "0px";<br />
document.getElementById(this.content).style.display = "none";<br />
this.CloseBlock();<br />
}<br />
else<br />
{<br />
this.OpenBlock();<br />
document.getElementById(this.content).style.display = "block";<br />
document.getElementById(this.body).style.padding = "20px";<br />
document.getElementById(this.body).style.height = "auto";<br />
}<br />
<br />
this.size = 0;<br />
}<br />
<br />
function OpenBlock()<br />
{<br />
if(this.size <= 100)<br />
{<br />
document.getElementById(this.body).style.height = this.size+"px";<br />
this.size++;<br />
setTimeout(function(){this.OpenBlock();}, this.speed);<br />
}<br />
}<br />
<br />
function CloseBlock()<br />
{<br />
if(this.size >= 0)<br />
{<br />
document.getElementById(this.body).style.height = this.size+"px";<br />
this.size--;<br />
setTimeout(function(){this.CloseBlock();}, this.speed);<br />
}<br />
}<br />
cdmlb
|
|
|
|
|
cdmlb@hotmail.com wrote: this.size = 0;
Should be set to 100 when opening.
|
|
|
|
|
i need to know what is the diffrent in the syntacs of html
between visted link and unvisted link...
i know the coulur become diffrent but when i c the html code i find the same..
|
|
|
|
|
The syntax is the same, the thing that changes the color is the BROWSERS history and not the html itself.
If you want to change the colors of links using Cascading Style Sheets - CSS
<br />
a<br />
{<br />
color: Blue;<br />
}<br />
<br />
a:visited<br />
{<br />
color: Red;<br />
}<br />
cdmlb
-- modified at 21:41 Sunday 2nd April, 2006
|
|
|
|
|
i just want to retrive all links that are visted....
then how can i do this...
|
|
|
|
|
I'm prety sure it's possible, I have it in my head, but could be tricky.
Could always try to use cookies, sessions, you want to do this
with what language, because would not be able to do it with just html,
you would have to do some javascript, or maybe even server side stuff like
asp or php?
cdmlb
|
|
|
|
|
in fact i am working with c#..
and i process the elemnt in the page by ihtmldocoument...
and i could get all links tag...
but i dont know how to get the visted link..
has it unique attribute?
|
|
|
|
|
This could help if you are using IIS webserver for your C# asp.net concept.
The IIS log files show every single page visited, and all links clicked on.
Not for just the current session, but all sessions.
Found this made with that suck VB.net, but could be converted to C#
in some litle time, since the function name are all prety much the same
when it comes to .NET stuff.
http://www.15seconds.com/issue/021119.htm
IIS log files are normaly stored on in location
C:\WINDOWS\system32\Logfiles
Prety sure no attibute for a visited link
only diff is that a visited link is stored in the browsers history,
you click on a link and it gets added to the history/log-files.
cdmlb
|
|
|
|
|
I need develop version of WEB site for PDA or adoptate current web site under PDA.. Tell me please how can i did it ?
Does anybody knows about PDA emulators , etc ?
How can i test it ?
Thanks in advance ,
Regards !
|
|
|
|
|
|
When I execute this VBscript I get the following error. Does anyone have an idea how to resolve this issue? The xml it tries to parser is down below labled xml file.
Thanks.
'*********************************** xml parser CODE*******************************
Set xmlDoc = Server.CreateObject("MSXML2.DOMDocument")
xmlDoc.async = False
xmlDoc.setProperty "ServerHTTPRequest", true
xmlDoc.loadXML(objHttp.responseText)
xmlDoc.loadXML(sOutPut)
Response.write sOutPut.documentElement.selectSingleNode("ebrary_username")
************************************ XML FILE
<brary-user-response version="1" status="success">
<brary_username>bry_teets7etrfr1ss8s
************************************
ERROR MESSAGE
--------------------------------------------------------------------------------
Invalid at the top level of the document. Error processing resource ...
Parsing Error......
|
|
|
|
|
Whenever you press the Print Screen button on your keyboard the actual window is copied into the windows clipboard. (Run clipbrd)
Is there any javascript code that would allow copying the windows clipboard contents into a texarea of a form?
-- modified at 20:33 Monday 3rd April, 2006
|
|
|
|
|
|
Hi.I have a project with 3 files "***.java" and the program result is loaded in a html file as java applet.Is there anyway to return all this in a windows application without rewriting all code?I use Visual Studio 2005.NET
|
|
|
|
|
Hello Guys,
I'm working to automate Time Table generation process for the school orgainsation, and I
stuck up here that:
I've list of records called subject, and each subject can have different sections. These
sections define the timing and day when classes can be taken.
As per the requirement when student select subjectS, we need to generate all possible time
tables where sections are non conflicted (time and day).
I managed to get a list of sections for EACH subject that are non conflicted with subject's
section but I'm unable to get the final one.
E.g. I selected three subjects and I got these three tables.
CCSB164 subject 1
<subjectcode:section> -> <subjectcode:section>
CCSB164:01A -> CCSB223:02
CCSB164:01A -> CCSB223:03
CCSB164:01A ->CMPB234:01
CCSB164:01B ->CCSB223:02
Each record says that Section of Subject CCSB164 not conflicting with section of another
subject like CCSB223.
CCSB223 subject 2
CCSB223:01 ->CMPB234:01
CCSB223:02 ->CCSB164:01A
CCSB223:02 ->CCSB164:01B
CCSB223:02 ->CMPB234:01
CCSB223:03 ->CCSB164:01A
CCSB223:03 ->CMPB234:01
CMPB234 subject 3
CMPB234:01 ->CCSB164:01A
CMPB234:01 ->CCSB223:01
CMPB234:01 ->CCSB223:02
CMPB234:01 ->CCSB223:03
If I take first row of first table it says: CCSB164:01A -> CCSB223:02 that means section 02
of CCSB223:02 does not conflict with Section CCSB164:01A but how I will check if CCSB223:02
does not conflict with other subjects too.
I tried to do Join based on Table1.Column2 = Table2.Column1 and Table2.Column2 =
Table3.Column1 and Table3.Column2 = Table1.column1 but it give cross product and it does not
work for me.
THESE tables are dynamically generated, and number of tables depends on number of subject
selected.
Hope my question is clear to answer for others Please help
FYI: I am using .Net technology. I don't know what logic I should apply and hence it does
not matter what technology I am using here.
"Practice Make Man Perfect"
|
|
|
|
|
Hi All,
I need to call an ajax method when user hit on browser back button...
So how can i trace this event...
If any body has idea abt this plssss help me out...
Thanx & regards
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
This is what you are looking for.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Thanx Buddy for your afferts, I want the same But this Msg should be seen only when user click on browser back right now it's showing the msg on every link as u wrote the function on pageunload event...But in this function we can not check like - page unloading due to browser back?
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|