webForum webForum sponsras med lina och serverplats av Binero AB

Gå tillbaka   webForum > Utveckling > Webbutveckling > Javascript

Javascript Här diskuteras det som rör Javascript, AJAX, DOM & DHTML.

Svar
 
Trådverktyg Visningsalternativ
Äldre 2012-05-27, 12:16   #1
swingman
Medlem
 
Registrerad: 2006-01-15
Inlägg: 86
Lösningar: 0
att visa det man sökt när man klickar på knappen

Jag har en en html sida där jag vill skriva in text i en sök ruta och när jag klicka på en submit knapp så ska det jag har sökt dyka upp under. Alltså det jag söker finns på sidan men gömd och ska bara visas om jag söker fram det det. Jag har skrivit kod som jag tänker borde funka men den gör inte det. Någon som kan hjälpa mig?
Kod:
window.onload = init;

function init () {
	hideAllPublications();
	createForm();
}

function hideAllPublications () {
document.getElementById('publications').style.display='none'; 

// will hide the html element having id 'divId'

//document.getElementById('publications').style.display=''; 
// will show the html element having id 'divId'
}

function createForm () {
	var _body = document.getElementsByTagName('body') [0];
	var _div = document.createElement('div');
	_div.setAttribute('id','div1');
	
    	var inputBox=document.createElement('input');
	inputBox.setAttribute('id','myInput');
	_div.appendChild(inputBox)[0];
	_body.appendChild(_div);	
	document.getElementById('myInput').focus();

    	mybutton=document.createElement('BUTTON');
	mybutton.style.height=20;
	mybutton.style.width=75;
    
    	theText=document.createTextNode('Search');//assign the value of the button
    	mybutton.appendChild(theText);	
	//mypara.appendChild(mybutton); 
	_div.appendChild(mybutton); 

	mybutton.onClick = searchAndDisplayResults();
}

function searchAndDisplayResults () {
		var divPublications = document.getElementById('publications');
		var div1 = document.getElementById("div1");
		
		var para = divPublications.getElementsByTagName('p');
		var soktext = div1.getElementsById('myinput'); 
					
		for(var i = 1; i < para.length; i++){
			if(soktext== para[i].nodeValue){			
			document.para[i].value.style.display='';
			}
		}
			
}
HTML koden är:
Kod:
	<body>
		<div id="publications">
			<h1>Publications</h1>
			<p>
				Ackerman, James S. (1966). Palladio. Penguin Books
			</p>
			<p>
				Ackerman, M S. (1999). Organizational memory: processes, boundary objects, and trajectories.
			</p>
			<p>
				Alexander, Christoffer (1979). Notes on the Synthesis of Form. Oxford University Press: New York.
			</p>
			<p>
				Alexander, Christoffer (1979). The Timeless Way of Building. Oxford University Press: New York.
			</p>
			<p>
				Alexander, Christoffer (1980). A Pattern Language. Oxford University Press: New York.
			</p>
			<p>
				Alexander, Christoffer (1981). The Oregon Experiment. Oxford University Press: New York.
			</p>
			<p>
				Allen, Robert B (1997). Mental Models and User Models. Elsevier Science B. V
			</p>
			<p>
				Andersen, P. B. (1990). A Theory of Computer Semiotics. Cambridge University Press: Cambridge, UK.
			</p>
			<p>
				Bannon, Liam J. (1991). From Human Factors to Human Actors: The Role of Psychology and Human-Computer Interaction Studies in System Design. Lawrence Erlbaum Associates: Mahwah, NJ.
			</p>
			<p>
				Bier, Eric A. (1994). A Taxonomy of See-Through Tools.
			</p>
			<p>
				Bier, Eric A. (1993). Toolglass and Magic Lenses: The See-Through Interface. ACM Press: Anaheim.
			</p>
			<p>
				Boden, Margaret A (1990). The Philosophy of Artificial Intelligence. Oxford University Press: New York.
			</p>
			<p>
				Bordegoni, Monica (1994). Parallel Use of Hand Gestures and Force-Input Device for Interacting with 3D and Virtual Reality Environments.
			</p>
			<p>
				Borghoff, Uwe M. (2000). Computer-supported Cooperative Work. Springer Verlag: Berlin, Heidelberg, New York.
			</p>
			<p>
				Boroditsky, Lera (2000). Metaphoric structuring: understanding time through spatial metaphors.
			</p>
			<p>
				Brown, John Seely (1994). Borderline Issues: Social and Material Aspects of Design.
			</p>
			<p>
				Bødker, Susanne (1998). Understanding Representation in Design.
			</p>
			<p>
				Cairncross, Frances (1997). The Death of Distance. How the Communications Revolution Will Change Our Lives.. Harvard Business School Press: Boston, Massachusetts.
			</p>
			<p>
				Card, Stuart K. (1996). Visualizing Retrieved Information: A Survey.
			</p>
			<p>
				Card, Stuart K. (1996). The human, the computer, the task, and their interaction: Analytic models and use-centered design. Erlbaum: Hillsdale, NJ.
			</p>
			<p>
				Card, Stuart K. (1999). Readings in information visualization. Using vision to think.. Morgan Kaufman Publishers, Inc.: San Fransisco, California.
			</p>
			<p>
				Card, Stuart K. (1983). The Psychology of Human-Computer Interaction. Lawrence Erlbaum Associates: Hillsdale, NJ.
			</p>
			<p>
				Card, Stuart K. (1994). The Cost-of-Knowledge Characteristic Function: Display Evaluation for Direct-Walk Dynamic Information Visualizations.
			</p>
			<p>
				Card, Stuart K. (1996). The WebBook and the Web Forager: An Information Workspace for the World-Wide Web.
			</p>
			<p>
				Carroll, John M. (1991). Designing Interaction: Psychology at the human-computer interface. Cambridge University Press: New York.
			</p>
			<p>
				Carroll, John M. (1997). Human-Computer Interaction: Psychology as a Science of Design.
			</p>
			<p>
				Carroll, John M. (1989). Artifacts as Psychological Theories: The Case of Human-Computer Interaction.
			</p>
			<p>
				Carroll, John M. (1989). Artifact as Theory-Nexus: Hermeneutics Meet Theory-Based Design.
			</p>
			<p>
				Carroll, John M. (1985). Metaphor, Computing Systems, and Active Learning.
			</p>
			<p>
				Cavaye, A. L. M. (1995). Participation in the Development of Interorganizational Systems Involving Users Outside the Organization.
			</p>
			<p>
				Chatty, Stephane (1996). Pen Computing for Air Traffic Control.
			</p>
			<p>
				Chen, Chaomei (1999). Information Visualization and Virtual Environments. Springer Verlag
			</p>
			<p>
				Chen, Hao (2000). Bringing Order to the Web: Automatically Categorizing Search Results.
			</p>
			<p>
				Chi, Ed H. (2000). A Taxonomy of Visualization Techniques using the Data State Reference Model. IEEE Press: Salt Lake City, Utah.
			</p>
			<p>
				Chi, Ed H. (2000). The Scent of a Site: A System for Analyzing and Predicting Information Scent, Usage, and Usability of a Web Site.
			</p>
			<p>
				Clark, Andy (1997). Being There. Putting Brain, Body and World Together Again. MIT Press: Cambridge, Massachusetts.
			</p>
			<p>
				Conklin, Jeff (1987). Hypertext: An Introduction and Survey.
			</p>
			<p>
				Couclelis, Helen (1994). Editorial : Spatial Technologies.
			</p>
			<p>
				Coyne, Richard (1995). Designing Information Technology in the Postmodern Age. From Method to Metaphor. The MIT Press: Cambridge, Massachusetts.
			</p>
			<p>
				Dahlbom, Bo (1997). The New Informatics.
			</p>
			<p>
				Davies, Char (1998). OSMOSE: Notes on Being in Immersive Virtual Space.
			</p>
			<p>
				Deerwester, Scott C. (1990). Indexing by Latent Semantic Analysis.
			</p>
			<p>
				Dix, Alan (2000). Exploiting Space and Location as a Design Framework for Interactive Mobile Systems.
			</p>
			<p>
				Donath, Judth (1995). Visual Who: Animating the affinities and activities of an electronic community.
			</p>
			<p>
				Dourish, Paul (2001). Where the Action Is: The Foundations of Embodied Interaction. MIT Press: Cambridge.
			</p>
			<p>
				Dourish, Paul (2001). Seeking a Foundation for Context-Aware Computing.
			</p>
			<p>
				Englander, Irv (2000). The Architecture of Computer Hardware and System Software: An Information Technology Approach. John Wiley &amp;amp Sons: New York.
			</p>
			<p>
				Faloutsos, Christos (1995). A Survey of Information Retrieval and Filtering Methods.
			</p>
			<p>
				Fernandez-Duque, Diego (1999). Attention Metaphors: How Metaphors Guide the Cognitive Psychology of Attention.
			</p>
			<p>
				Fitzmaurice, George W. (1993). Virtual Reality for Palmtop Computers.
			</p>
			<p>
				Fodor, Jerry (1981). The present status of the innateness controversy. MIT Press: Cambridge.
			</p>
			<p>
				Freundschuh, A (1996). Spatial Image Schemata, Locative Terms and Geographic Spaces in Children's Narrative: Fostering Spatial Skills in Children.
			</p>
			<p>
				Furnas, George W. (1986). Generalized Fisheye Views.
			</p>
			<p>
				Gardner, Howard (1985). The mind's new science. A history of the cognitive revolution. Basic Books: New York.
			</p>
			<p>
				Gendlin, Eugene (1962). Experiencing and the Creation of Meaning. A Philosophical and Psychological Approach to the Subjective. Northwestern University Press: Evanston, Illinois.
			</p>
			<p>
				Gibbs, Raymond W. (1994). The Poetics of Mind. Figurative Thought, Language, and Understanding. Cambridge University Press: Cambridge.
			</p>
			<p>
				Gibbs, Raymond W. (1997). Language and Creative Thought. American Psychological Association: Washington, DC.
			</p>
			<p>
				Gibbs, Raymond W. (1997). Taking metaphor out of our heads and putting it into the cultural world. John Benjamins Publishing Co: Amsterdam.
			</p>
			<p>
				Gibbs, Raymond W. (1994). Taking a stand on the meaning of stand: Bodily experience as motivation for polysemy.
			</p>
			<p>
				Gibbs, Raymond W. (1995). The cognitive psychological reality of image schemas and their transformations.
			</p>
			<p>
				Goffman, Erving (1959). The presentation of self in everyday life. Doubleday: Garden City, New York.
			</p>
			<p>
				Halasz, Frank (1982). Analogy Considered Harmful.
			</p>
			<p>
				Handa, Rumiko (1999). Against Arbitrariness: Architectural Signification in the Age of Globalization.
			</p>
			<p>
				Hanson, Norwood Russell (1958). Patterns of discovery. The Syndics of the Cambridge University Press
			</p>
			<p>
				Harrison, Steve (1996). Re-Place-ing Space: The Roles of Place and Space in Collaborative Systems.
			</p>
			<p>
				Harvey, L (1995). Scholarship and practice: the contribution of ethnographic research methods to bridging the gap.
			</p>
			<p>
				Hasan, Helen (1992). Executive-Computer Interfaces -- A Case Study.
			</p>
			<p>
				Hayles, N. Katherine (1999). How We Became Posthuman. Virtual Bodies In Cybernetics, Literature, and Informatics. The University of Chicago Press: Chicago.
			</p>
			<p>
				Henderson, Kathryn (1999). On Line and On Paper. Visual Representations, Visual Culture, and Computer Graphics in Design Engineering. The MIT Press: Cambridge, Massachusetts.
			</p>
			<p>
				Hollan, James (2000). Distributed Cognition: Toward a New Foundation for Human-Computer Interaction Research.
			</p>
			<p>
				Honderich, Ted (1995). The Oxford Companion to Philosophy. Oxford University Press
			</p>
			<p>
				Houde, Stephanie (1997). What do Prototypes Prototype?. Elsevier Science B. V
			</p>
			<p>
				Hutchins, Edwin (1995). Cognition in the Wild. MIT Press: Cambridge, MA.
			</p>
			<p>
				Hutchins, Edwin (1995). How a cockpit remembers its speeds.
			</p>
			<p>
				Hutchins, Edwin L. (1986). Direct Manipulation Interfaces.
			</p>
			<p>
				Innis, Harold A (1951). The Bias of Communication. University of Toronto Press: Toronto.
			</p>
			<p>
				Ishii, Hiroshi (1997). Tangible Bits: Towards Seamless Interfaces between People, Bits and Atoms.
			</p>
			<p>
				Janlert, Lars-Erik (1997). The character of things.
			</p>
			<p>
				Johansson, Ingvar (1993). Positivism och Marxism. Daidalos
			</p>
			<p>
				John, Bonnie (1995). Why GOMS?.
			</p>
			<p>
				John, Bonnie E. (1996). The GOMS Family of User Interface Analysis Techniques: Comparison and Contrast.
			</p>
			<p>
				Johnson, Brian (1991). Treemaps: A Space-Filling Approach to the Visualization of Hierarchical Information Structures.
			</p>
			<p>
				Johnson, Mark (1987). The Body in the Mind. The Bodily Basis of Meaning, Imagination, and Reason. Chicago University Press: Chicago.
			</p>
			<p>
				Johnson, Mark (1993). Moral Imagination : Implications of Cognitive Science for Ethics. Chicago University Press: Chicago.
			</p>
			<p>
				Kallinikos, Jannis (1996). Technology and Society. Accedo: Munich.
			</p>
			<p>
				Kaptelinin, Victor (1996). Computer-mediated activity: Functional organs in social and developmental contexts. The MIT Press: Cambridge, Mass.
			</p>
			<p>
				Karat, John (1997). User-Centered Software Methodologies. Elsevier Science B. V
			</p>
			<p>
				Kidd, Alison (1994). The Marks are on the Knowledge Worker.
			</p>
			<p>
				Kieras, David E. (1997). A Guide to GOMS Model Usability Evaluation Using NGOMSL. Elsevier Science B. V
			</p>
			<p>
				Kleinrock, Leonard (1996). Nomadicity: Anytime, Anywhere In A Disconnected World.
			</p>
			<p>
				Kokotovich, Vasilije (2000). Mental synthesis and creativity in design: an experimental examination.
			</p>
			<p>
				Komito, L. (1998). Paper 'work' and electronic files: defending professional practice.
			</p>
			<p>
				Koons, David B. (1994). ICONIC: Speech and Depictive Gestures at the Human-Machine Interface.
			</p>
			<p>
				Kosara, Robert (2002). Focus+Contex Taken Literally.
			</p>
			<p>
				Kövecses, Zoltán (1997). Metaphor. Does it constitute or reflect cultural models?. John Benjamins Publishing Co: Amsterdam.
			</p>
			<p>
				Löwgren, Jonas (1998). Design Av Informationsteknik: Materialet Utan Egenskaper. Studentlitteratur AB
			</p>
			<p>
				Lakoff, George (1987). Women, Fire, and Dangerous Things : What Categories Reveal About the Mind. University of Chicago Press
			</p>
			<p>
				Lakoff, George (1990). The Invariance Hypothesis: is abstract reason based on image schemas?.
			</p>
			<p>
				Lakoff, George (1993). The Contemporary Theory of Metaphor. Cambridge University Press
			</p>
			<p>
				Lakoff, George. (1980). Metaphors We Live By. University of Chicago Press: Chicago.
			</p>
			<p>
				Lakoff, George (1999). Philosophy In The Flesh: The Embodied Mind and Its Challenge to Western Thought. Basic Books: New York.
			</p>
			<p>
				Lakoff, George (2000). Where Mathematics Comes From: How the Embodied Mind Brings Mathematics into Being. Basic Books: New York.
			</p>
			<p>
				Lakoff, George (1989). More than Cool Reason. A Field Guide to Poetic Metaphor.. The University of Chicago Press: Chicago.
			</p>
			<p>
				Landauer, Thomas (1991). Let's Get Real: A Position Paper on the Role of Cognitive Psychology in the Design of Humanly Useful and Usable Systems. Cambridge University Press: New York.
			</p>
			<p>
				Latour, Bruno (1986). Visualization and cognition: thinking with eyes and hands.
			</p>
			<p>
				Latour, Bruno (1999). Pandora's Hope. An Essay on the Reality of Science Studies. Harvard University Press
			</p>
			<p>
				Leung, Y. K. (1994). A Review and Taxonomy of Distortion-Oriented Presentation Techniques.
			</p>
			<p>
				Levin, David Michael (1997). Language Beyond Postmodernism. Saying and Thinking in Gendlin's Philosophy.. Northwestern University Press: Evanston, Illinois.
			</p>
			<p>
				Lewis, David (2002). Convention. Blackwell Publishing: UK, Bodmin, Cornwall.
			</p>
			<p>
				Long, Allan Christian (1998). Improving Gestures and Interaction Techniques for Pen-Based User Interfaces.
			</p>
			<p>
				Long, Allan Christian (1999). Implications for a Gesture Design Tool.
			</p>
			<p>
				Luff, Paul (1998). Mobility in Collaboration.
			</p>
			<p>
				Lund, Andreas (1996). Behaviour out of place: The World Wide Web and its impact on everyday life. Gothenburg studies in Informatics: Gothenburg.
			</p>
			<p>
				Lund, Andreas (1997). Embodied Interfaces. Department of Informatics, University of Oslo: Oslo.
			</p>
			<p>
				Lund, Andreas (1998). Massification of the Intangible. Towards contextualized information visualization. Department of Computer Science, Aalborg University: Sëby Søbad, Denmark.
			</p>
			<p>
				Lund, Andreas (2000). Evolving the Shape of Things to Come: A Comparison of Direct Manipulation and Interactive Evolutionary Design. Alea Design Publisher: Rome.
			</p>
			<p>
				Lund, Andreas (2001). Exploring TypeSpace: A Comparative Study of Interactive Evolution and Direct Manipulation. : Tokyo, Japan.
			</p>
			<p>
				Lund, Andreas (1997). Experiential Design: Reflecting Embodiment at the Interface.. Linköping University, Computer Science Department: Linköping, Sweden.
			</p>
			<p>
				Lund, Andreas (1998). Experiential Design: Reflecting Embodiment at the Interface. University of Aizu, Japan: Aizu-Wakamatsu.
			</p>
			<p>
				Lund, Andreas (2001). Situating events in RoamViz: Using spatio-temporal dimensions to visualize sustained and dynamic mobile projects. : Ulvik, Norway..
			</p>
			<p>
				Mackinlay, Jock (1988). Applying a Theory of Graphical Presentation to the Graphic Design of User Interfaces.
			</p>
			<p>
				Mackinlay, Jock D. (1991). The Perspective Wall: Detail and Context Smoothly Integrated.
			</p>
			<p>
				Maglio, Paul (1996). Apparent motion on the World Wide Web. Erlbaum: Mahwah, NJ.
			</p>
			<p>
				Maglio, Paul (1999). The Conceptual Structure of Information Space. Springer Verlag
			</p>
			<p>
				Malone, Thomas W. (1983). How Do People Organize Their Desks? Implications for the Design of Office Information Systems.
			</p>
			<p>
				Mander, Richard (1992). A 'Pile' Metaphor for Supporting Casual Organization of Information.
			</p>
			<p>
				Margolin, Victor (2002). The Politics of the Artificial. The University of Chicago press: Chicago.
			</p>
			<p>
				Marks, Lawrence E. (1982). Synesthetic perception and poetic metaphor.
			</p>
			<p>
				Marks, Lawrence E. (1982). Bright sneezes and dark coughs, loud sunlight and soft moonlight.
			</p>
			<p>
				Martin, Elizabeth (2000). A Dictionary of Biology. Oxford University Press
			</p>
			<p>
				McKendree, Jean (1995). The "Homeopathic Fallacy" in Learning from Hypertext.
			</p>
			<p>
				McLuhan, Marshall (1964). Understanding Media. The MIT Press: Cambridge.
			</p>
			<p>
				McNeill, David (1992). Hand and Mind. What Gestures Reveal About Thought. The University of Chicago Press: Chicago.
			</p>
			<p>
				Meyrowitz, Joshua (1985). No Sense of Place: The Impact of Electronic Media on Social Behaviour. Oxford University Press: New York.
			</p>
			<p>
				Mijksenaar, Paul (1997). Visual Function: An Introduction to Information Design. Princeton Architectural Press
			</p>
			<p>
				Mingers, John (2001). Embodying information systems: the contribution of phenomenology.
			</p>
			<p>
				Myers, Michael D (1999). Investigating Information Systems with Ethnographic Research.
			</p>
			<p>
				Neale, Dennis C. (1997). The Role of Metaphor in User Interface Design. Elsevier Science B. V
			</p>
			<p>
				Newell, Alan (1976). Computer Science as Empirical Enquiry.
			</p>
			<p>
				Newman, William M. (1995). Interactive Systems Design. Addison-Wesley: Cambridge.
			</p>
			<p>
				Nielsen, Jakob (1994). Usability Engineering. Morgan Kaufmann Publishers: San Francisco.
			</p>
			<p>
				Olson, Gary M. (2000). Distance Matters.
			</p>
			<p>
				Orlikowski, Wanda J. (1992). The Duality of technology: Rethinking the concept of technology in Organizations.
			</p>
			<p>
				Orlikowski, Wanda J. (2000). Using Technology and Constituting Structures: A Practice Lens for Studying Technology in Organizations.
			</p>
			<p>
				Orlikowski, W J. (2001). Desperately seeking the 'IT' in IT research- a call to theorizing the IT artifact.
			</p>
			<p>
				Oxman, Rivka (2002). The thinking eye: visual re-cognition in design emergence.
			</p>
			<p>
				Perkins, Charles E. (2001). Ad Hoc Networking: An Introduction. Addison-Wesley
			</p>
			<p>
				Pirolli, Peter (1995). Information Foraging in Information Access Environments.
			</p>
			<p>
				Pirolli, Peter (in press). Information foraging.
			</p>
			<p>
				Preece, Jenny (1994). Human-Computer Interaction. Addison-Wesley Publishing: Reading, Mass..
			</p>
			<p>
				Quinn, Naomi (1991). The Cultural Basis of Metaphor. Stanford University Press: Stanford, California.
			</p>
			<p>
				Raubal, Martin (1997). Structuring Space with Image Schemata: Wayfinding in Airport as a Case Study.
			</p>
			<p>
				Rekimoto, Jun (1999). Time-Machine Computing: A Time-Centric Approach for the Information Environment.
			</p>
			<p>
				Rheinfrank, John (1994). Innovation and Design: The Emerging Boundary Conditions.
			</p>
			<p>
				Robertson, George (2000). The Task Gallery: A 3D Window Manager.
			</p>
			<p>
				Salton, Gerard (1994). Automatic structuring and retrieval of large text files.
			</p>
			<p>
				Sarkar, Manojit (1992). Graphical Fisheye Views of Graphs.
			</p>
			<p>
				Sarkar, Manojit (1993). Stretching the Rubber Sheet: A Metaphor for Visualizing Large Layouts on Small Screens.
			</p>
			<p>
				Scriven, Michael (1967). The Methodology of Evaluation. Rand McNally \&amp; Company: Chicago.
			</p>
			<p>
				Sellen, Abigail J. (2002). The Myth of the Paperless Office. MIT Press: Cambridge, Massachusetts.
			</p>
			<p>
				Shannon, C E. (1949). The Mathematical Theory of Communication. University of Illinois Press: Urbana.
			</p>
			<p>
				Shneiderman, Ben (1982). The Future of Interactive Systems and the Emergence of Direct Manipulation.
			</p>
			<p>
				Shneiderman, Ben (1982). The Future of Interactive Systems and the Emergence of Direct Manipulation.
			</p>
			<p>
				Shneiderman, Ben (1996). The Eyes Have It: A Task by Data Type Taxonomy for Information Visualizations. IEEE
			</p>
			<p>
				Shneiderman, Ben (2000). Universal Usability.
			</p>
			<p>
				Smith, Randall B. (1987). Experiences with the Alternate Reality Kit: An Example of the Tension between Literalism and Magic.
			</p>
			<p>
				Spellman, Peter J. (1997). Collaborative Virtual Workspace.
			</p>
			<p>
				Spence, Robert (2000). Information Visualization. Addison-Wesley
			</p>
			<p>
				Star, Susan Leigh (1989). The Structure of Ill-Structured Solutions: Boundary Objects and Heterogeneous Distributed Problem Solving. Morgan Kaufmann Publishers
			</p>
			<p>
				Steen, Francis F. (2000). Grasping Philosophy by the Roots.
			</p>
			<p>
				Sternberg, Robert J. (1999). Cognitive Psychology. Harcourt Brace College Publishers: Orlando.
			</p>
			<p>
				Stolterman, Erik (1991). Designarbetets dolda rationalitet. En studie av metodik och praktik inom systemutveckling.. Institutionen för Informationsbehandling. Umeå Iniversitet.: Umeå.
			</p>
			<p>
				Stolterman, Erik (2002). Creating Community in Conspiracy with the Enemy. Routledge: London.
			</p>
			<p>
				Stolterman, Erik (in press). The DesignWay. Educational Technology Publishing
			</p>
			<p>
				Stone, Maureen C. (1994). The Movable Filter as a User Interface Tool.
			</p>
			<p>
				Suchman, Lucy A. (1987). Plans and Situated Actions: The Problem of Human-Computer Communication. Cambridge University Press: New York.
			</p>
			<p>
				Sunstein, Cass (2001). Republic.com. Princeton University Press
			</p>
			<p>
				Talbott, Stephen L. (1995). The Future does not Compute: Transcending the Machines in our midst. O'Reilly \&amp; Associates
			</p>
			<p>
				Tweedie, Lisa (1997). Characterizing Interactive Externalizations.
			</p>
			<p>
				Vanderheiden, Gregg (2000). Fundamental Principles and Priority Setting for Universal Usability. ACM Press: Arlington, VA.
			</p>
			<p>
				Varela, Francisco J. (1991). The Embodied Mind. Cognitive Science and Human Experience. MIT Press: Cambridge, Massachusetts.
			</p>
			<p>
				Waterworth, Eva Lindh (2001). Perceptually-seductive technology. Designing computer support for everyday creativity. Umeå University: Umeå.
			</p>
			<p>
				Waterworth, John A. (1997). Creativity and Sensation: The Case for Synaesthetic Media.
			</p>
			<p>
				Waterworth, John A. (1997). Personal Spaces: 3D Spatial Worlds for Information Exploration, Organisation and Communication. Academic Press: New York.
			</p>
			<p>
				Waterworth, John A. (2000). Technology in Support of Returning. From Conscious Doing to Consciously Being. The Noetic Press: Orinda, California, USA.
			</p>
			<p>
				Waterworth, John A. (2002). Experiential Design of Shared Information Spaces. Springer: London.
			</p>
			<p>
				Weick, Karl E. (1989). Theory construction as disciplined imagination.
			</p>
			<p>
				Weiser, Mark (1994). The World is Not a Desktop.
			</p>
			<p>
				Wenger, Etienne (1998). Communities of Practice: Learning, Meaning and Identity. Cambridge University Press: New York.
			</p>
			<p>
				Wexelblat, Alan (1995). An Approach to Natural Gesture in Virtual Environments.
			</p>
			<p>
				Whitaker, Randall (1992). Venues for Contexture. A Critical Analysis and Enactive Reformulation of Group Decision Support Systems.. Institutionen för Informationsbehandling. Administrativ Databehandling. Umeå Universitet.: Umeå.
			</p>
			<p>
				Whittaker, Steve (1995). Back to the Future: Pen and Paper Technology Supports Complex Group Coordination.
			</p>
			<p>
				Whorf, Benjamin L. (1956). Language, Thought, and Reality: The selected writings of Benjamin Lee Whorf.. Wiley: New York.
			</p>
			<p>
				Wiberg, Mikael (2001). In between Mobile Meetings: Exploring seamless ongoing interaction support for mobile CSCW. Umeå University: Umeå.
			</p>
			<p>
				Virzi, Robert A. (1997). Usability Inspection Methods. Elsevier Science B. V
			</p>
			<p>
				Wolf, Catherine C. (1992). A Comparative Study of Gestural, Keyboard, and Mouse Interfaces.
			</p>
			<p>
				Yee, Ka-Ping (2003). Peephole Displays: Pen Interaction on Spatially Aware.
			</p>
			<p>
				Zuboff, Shoshana (1988). In the Age of the Smart Machine. The Future of Work and Power. Basic Books
			</p>
		</div>
	</body>
swingman besöker inte forumet just nu   Svara med citat
Äldre 2012-05-27, 12:43   #2
voigtann1
Forumvärd
 
voigtann1s avatar
 
Registrerad: 2001-06-14
Ort: Helsingborg
Inlägg: 8 502
Lösningar: 537
document.para[i].value.style.display=''

du vill i alla fall inte ha value där då value, du vill ha elementet som referens, sen döljer du #publications och visar aldrig den, det du vill göra om jag förstå dig rätt är ju att du vill dölja p-elementen, inte div för att sedan visar specifika p-element?

och din soktext kräver en sträng för att söka, vilket du inte gör, du hämtar DOM-referensen i detta fall skall du använda dig av value.

När du binder event så är det metodnamn du binder du vill inte (i detta fall i alla fall) köra metoden searchAndDisplayResults utan binda metoden på click eventet:

Kod:
mybutton.onclick = searchAndDisplayResults;
(små bokstäver på onclick också) inte
Kod:
mybutton.onClick = searchAndDisplayResults();
När du hämtar getElementById så är det case-sensitive du måste skriva myInput om det är det den heter, inte myinput.


Är det hela meneningen du vill eller är det delar av ord du vill söka upp, om jag skriver 1988 så skall den visar exempelvis:
Kod:
            <p>
                Zuboff, Shoshana (1988). In the Age of the Smart Machine. The Future of Work and Power. Basic Books
            </p>
?
__________________
"det går inte att lära en gammal norrlänning byta namn på irc" - gammalt kinesiskt uttryck
voigtann1 besöker inte forumet just nu   Svara med citat
Äldre 2012-05-28, 00:23   #3
swingman
Medlem
 
Registrerad: 2006-01-15
Inlägg: 86
Lösningar: 0
Du har förstått mig rätt! Jag har nu gjort om att jag inte döljer hela diven utan döljer just det som ligger i p taggarna. Det fungerar. Det jag har problem med nu är att följande inte fungerar
Kod:
	var searchString = document.getElementsById('myInput').value;
	mybutton.onclick = alert(searchString);
Ser du någon något fel i ovanstående kod? Jag har skrivit resten som jag tänker att det ska funka men det är säkert en del fel ändå. Hela koden följer här:
Kod:
window.onload = init;

function init () {
	hideAllPublications();
	createForm();
}

function hideAllPublications () {
	var publications = document.getElementById('publications');
	var para = publications.getElementsByTagName('p');
	
	for(var i = 0; i < para.length; i++){
		para[i].style.display= 'none';
		}
}

function createForm () {
	var _body = document.getElementsByTagName('body') [0];
	var _div = document.createElement('div');
	_div.setAttribute('id','div1');
	
    	var inputBox=document.createElement('input');
	inputBox.setAttribute('id','myInput');
	_div.appendChild(inputBox)[0];
	_body.appendChild(_div);	
	document.getElementById('myInput').focus();

    	mybutton=document.createElement('BUTTON');
	mybutton.style.height=20;
	mybutton.style.width=75;
    
    	theText=document.createTextNode('Search');//assign the value of the button
    	mybutton.appendChild(theText);	
	_div.appendChild(mybutton); 

	//mybutton.onclick = searchAndDisplayResults;

	var searchString = document.getElementsById('myInput').value;
	mybutton.onclick = alert(searchString);
}

function searchAndDisplayResults () {
	var searchString = document.getElementsById('myInput').value;

	var publications = document.getElementById('publications');
	var para = publications.getElementsByTagName('p');
	
	for(var i = 0; i < para.length; i++){
		var str = para[i].value;
		if (str.indexOf('searchString')){
		para[i].style.display= '';
		}
	}
		
}
swingman besöker inte forumet just nu   Svara med citat
Äldre 2012-05-28, 06:24   #4
voigtann1
Forumvärd
 
voigtann1s avatar
 
Registrerad: 2001-06-14
Ort: Helsingborg
Inlägg: 8 502
Lösningar: 537
Ja, du kan ju inte kommentera ut koden som binder event. p-element har inget som heter .value i DOM-en, du vill också (gissar jag på) om den inte hittar texten så skall du inte visa det heller, sen kan du inte gemföra med indexOf('searchString') du söker efter en sträng med värdet 'searchString' du vill nog köra mot variablen searchString istället
__________________
"det går inte att lära en gammal norrlänning byta namn på irc" - gammalt kinesiskt uttryck
voigtann1 besöker inte forumet just nu   Svara med citat
Äldre 2012-05-28, 22:13   #5
swingman
Medlem
 
Registrerad: 2006-01-15
Inlägg: 86
Lösningar: 0
här hänger inte jag med eller om du förstod mig rätt. Min huvud fråga är varför jag inte får någon alert.
Kod:
window.onload = init;

function init () {
	hideAllPublications();
	createForm();
}

function hideAllPublications () {
	var publications = document.getElementById('publications');
	var para = publications.getElementsByTagName('p');
	
	for(var i = 0; i < para.length; i++){
		para[i].style.display= 'none';
		}
}

function createForm () {
	var _body = document.getElementsByTagName('body') [0];
	var _div = document.createElement('div');
	_div.setAttribute('id','div1');
	
    	var inputBox=document.createElement('input');
	inputBox.setAttribute('id','myInput');
	_div.appendChild(inputBox)[0];
	_body.appendChild(_div);	
	document.getElementById('myInput').focus();

    	mybutton=document.createElement('BUTTON');
	mybutton.style.height=20;
	mybutton.style.width=75;
    
    	theText=document.createTextNode('Search');
    	mybutton.appendChild(theText);	
	_div.appendChild(mybutton); 

	var searchString = document.getElementsById('myInput');
	mybutton.onclick = alert(searchString);
}
swingman besöker inte forumet just nu   Svara med citat
Äldre 2012-05-28, 22:19 Markerad som löst av swingman   #6
voigtann1
Forumvärd
 
voigtann1s avatar
 
Registrerad: 2001-06-14
Ort: Helsingborg
Inlägg: 8 502
Lösningar: 537
för du binder inte en metodnamn till ett event, du kör metoden och vad den retunera är det du binder till onlclick:
Kod:
mybutton.onclick = function() {alert(searchString); }
kommer fungera bättre.
__________________
"det går inte att lära en gammal norrlänning byta namn på irc" - gammalt kinesiskt uttryck
voigtann1 besöker inte forumet just nu   Svara med citat
Äldre 2012-05-28, 22:24   #7
swingman
Medlem
 
Registrerad: 2006-01-15
Inlägg: 86
Lösningar: 0
nop! det fungerar inte det heller!
swingman besöker inte forumet just nu   Svara med citat
Äldre 2012-05-28, 22:33   #8
voigtann1
Forumvärd
 
voigtann1s avatar
 
Registrerad: 2001-06-14
Ort: Helsingborg
Inlägg: 8 502
Lösningar: 537
det är ju för att din kod krashar innan den kommer ner dit du har ju getElementsById det är inga element i plural du är ute efter utan getElementById inte Elements ta bort s, sen kommer searchString retunera DOM referensen, inte värdet ifrån elementet, bara så du vet. sen behöver du ju inte leta upp elementet, du har ju skapat den i samma metod och ha en referens till den redan inputBox
__________________
"det går inte att lära en gammal norrlänning byta namn på irc" - gammalt kinesiskt uttryck
voigtann1 besöker inte forumet just nu   Svara med citat
Äldre 2012-05-28, 22:57   #9
swingman
Medlem
 
Registrerad: 2006-01-15
Inlägg: 86
Lösningar: 0
så sant!
swingman besöker inte forumet just nu   Svara med citat
Svar
webForum > Utveckling > Webbutveckling > Javascript

Trådverktyg
Visningsalternativ

Forumregler
Du får inte posta nya trådar
Du får inte posta svar
Du får inte bifoga filer
Du får inte redigera dina inlägg

BB-kod är
Smilies är
[IMG]-kod är
HTML-kod är av

Forumhopp


Alla tider är i GMT +1. Klockan är nu 05:15.


Powered by: vBulletin Version 3.8.6
Copyright © webForum