Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Learnign JavaScript

JavaScript

  • Please log in to reply
47 replies to this topic

#13 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 31 May 2008 - 11:47 AM

Google mail is incredible, it uses JavaScript really well. I doubt I'll ever be able to make something that good but it gives a good idea that JavaScript can do just about anything.
  • 0

#14 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 31 May 2008 - 11:55 AM

Although there are some things, such as databases, which you need PHP for. A combination of both works well, I believe.
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#15 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 31 May 2008 - 12:59 PM

Can I still use Spartan with PHP?
  • 0

#16 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 31 May 2008 - 01:16 PM

Sure. It's just a replacement for HTML.
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#17 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 31 May 2008 - 01:19 PM

The only thing is I can't get it to work very well in Firefox. What works perfectly in IE doesn't work in firefox. Too bad they use the DOM differently. :(
  • 0

#18 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 01 June 2008 - 07:02 AM

Usually it's IE that implements things badly. Maybe you're not coding it properly - the article I got it from said that the examples had been tested in FF2 and IE7, and it worked perfectly. :)
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#19 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 01 June 2008 - 07:09 AM

Hmm maybe, what article did you use?
  • 0

#20 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 01 June 2008 - 07:22 AM

It was one in the UK computer magazine "Computer Shopper". I don't suppose it's available in Canada?
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#21 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 01 June 2008 - 07:26 AM

Yeah I don't think I can get it here. I'll post my code here:

window.onload=function()
{
	var button1 = document.createElement("button");
	button1.style.position="absolute";
	button1.style.top=25;
	button1.style.left=50;
	button1.style.width=150;
	button1.style.height=100;
	button1.innerHTML="Click Me";
	button1.onclick=function()
	 {
		window.alert("Goodbye HTML World");
	 }
	document.body.appendChild(button1);
	
	button=function(parent)
		{
			DOMObj=document.createElement("button");
			DOMObj.style.position="absolute";
			parent.appendChild(DOMObj);
			return DOMObj;
		}
	button2=new button(document.body);
	button2.style.top=35;
	button2.style.left=330;
	button2.style.width=75;
	button2.style.height=65;
	button2.value="Click Me";
	button2.onclick=function() { window.alert("Goodbye HTML World"); }
	
	
}

thought it doesn't show up that well in firefox, the width, height, top, left and value don't work in firefox. The onclick works though.
  • 0

#22 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 01 June 2008 - 07:36 AM

Hmm - the only thing different in the article is that the appendChild() is done before setting all the values. Try it...
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#23 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 01 June 2008 - 07:46 AM

Yeah didn't really work though.
  • 0

#24 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 01 June 2008 - 07:54 AM

Darn. :(
How come in one of them you use InnerHTML, the other you use value?
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download