Question:

3 javascript questions

by  |  earlier

0 LIKES UnLike

1. I'm trying to figure out some code and there is something I'm not familiar with. If you have no clue that's fine, but I thought maybe this meant something standard: .hp.

2. What does this chunk do and how does it work?

site.hp.unhideElements = function(){

var homepage = $("Homepage");

if(homepage){

homepage.style.visibility = "visible";

}

3. in the html script tag, it looks like this <script language="javascript" type="text/javascript" src="http://www.........js" import="menu quickfinder homepage ajax ></script>http://www...........js"></script> What is the import part doing? (note: that first </script> tag shouldn't be there but it kept appearing anyway)

 Tags:

   Report

2 ANSWERS


  1. 1. Are you sure you&#039;re not using some framework or something? I don&#039;t think that&#039;s standard.

    2. In prototypejs, for example, the dollar sign is a function that returns elements with the id given in the parameter.

     What this code does is it finds an element with the id Homepage. If it exists, it sets the visibility to &quot;visible&quot;.

    3. The import attribute is also non-standard. Probably it&#039;s used by the framework to load only certain functions.

    Sorry if the answer wasn&#039;t adequate enough.


  2. AJAX is a mashup of technologies to get webpages to do things they wouldn&#039;t be able to do otherwise.  I&#039;m pretty sure all of these things are part of AJAX.
You're reading: 3 javascript questions

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.