Có 60+ tài liệu thuộc chủ đề "thiết kế web với php"
tailieu.vn Xem trực tuyến Tải xuống
In the first part of this book, you’ll be getting familiar with the history and basic capabilities of jQuery. You'll also learn the basics of jQuery, including how to make the library available for use in your applications and how the core of jQuery—its powerful selector engine—works.. These libraries aimed to simplify the use of JavaScript to make it more...
tailieu.vn Xem trực tuyến Tải xuống
The basic selectors allow developers to select elements by tag type, class name, ID, or any combination thereof. While viewing http://localhost/testing/, launch the Firebug dialog, and click the Console tab (see Figure 1-4). If the Console panel is disabled, click the Console tab, and select Enabled. Selecting Elements by Tag Type. To select an element by tag type, simply use...
tailieu.vn Xem trực tuyến Tải xuống
21 which returns the following in the console:. span.foo. span, span.foo. Because your HTML example does not have any form elements in it, you’ll need to append the file with some new markup for the following examples.. In index.html, add the following HTML between the last paragraph tag and the first script tag:. <label for="name">Name</label><br />. <input name="name". id="name". /><br...
tailieu.vn Xem trực tuyến Tải xuống
$("p.foo").next();. This generates the following output:. $("p.foo").next("#bar");. To select all paragraphs after the paragraph with the class foo, use the following code:. $(".foo").nextAll("p");. This returns the following result:. The third method available for selecting next sibling elements is the .nextUntil() method. It’s important to note that the element matched by the selector will not be included in the result set.....
tailieu.vn Xem trực tuyến Tải xuống
41 INSPECTING HTML USING THE ELEMENT INSPECTOR IN FIREBUG. You can also see this by using the element inspection tool provided by Firebug. Click it to activate the element inspector.. The button to activate the element inspector. After the inspector is active, you can hover over different elements in the browser, and they'll highlight with a blue outline. This brings...
tailieu.vn Xem trực tuyến Tải xuống
To italicize all text in the paragraphs on the test page, use the following code:. .remove() and .detach(). To remove an element from the DOM entirely, the .remove() and .detach() methods are used. Both methods remove selected elements from the DOM, but the .detach() method keeps jQuery data for the element intact, which makes it ideal for situations in which...
tailieu.vn Xem trực tuyến Tải xuống
.height() and .width(). To obtain the height or width of an element, the .height() and .width() methods are handy. Both return a value without units, meaning the value returned is an integer (if the element is 68 pixels high,. Get the height of the form by running the following code:. console.log("Form height form").height()+"px");. This outputs the following in the console:....
tailieu.vn Xem trực tuyến Tải xuống
The .error() method allows developers to bind a handler (i.e., a function to be fired if the event occurs) to the event.. Create an image tag that tries to display an image that doesn’t exist, and attach an error handler to the error event that outputs a message to the console:. console.log("The image cannot be loaded!");. Upon execution of this...
tailieu.vn Xem trực tuyến Tải xuống
This results in the paragraph’s contents being replaced with new content from ajax.php (see Figure 2-23).. These defaults can be overwritten in subsequent calls to $.ajax() by simply redefining the option in the new call:. This results in the data being sent using GET (see Figure 2-24).. In a nutshell, these shorthand methods are simply wrapper functions that call $.ajax()...
tailieu.vn Xem trực tuyến Tải xuống
When working within a method, use $this in the same way you would use the object name outside the class.. To use these methods, call them just like regular functions, but first, reference the object to which they belong. echo $obj->getProperty. Set a new one echo $obj->getProperty. Get the value of $prop1 from both objects echo $obj->getProperty();. echo $obj2->getProperty();. $obj->setProperty("I'm...
tailieu.vn Xem trực tuyến Tải xuống
public function setProperty($newval). public function getProperty(). public function __construct(). ".<br />";. public function newMethod(). The class "MyClass". echo 'The class ". public function __destruct(). public function __toString(). In addition to its visibility, a method or property can be declared as static, which allows them to be accessed without an instantiation of the class.. Public Properties and Methods. This means that...
tailieu.vn Xem trực tuyến Tải xuống
immediately followed by the tag name and the value of the tag. @author: The author of the current element (which might be a class, file, method, or any bit of code) are listed using this tag. Multiple author tags can be used in the same DocBlock if more than one author is credited. The format for the author name is...
tailieu.vn Xem trực tuyến Tải xuống
index.php: This is the main file, which displays the month in calendar format with event titles displayed in the box of the day on which they occur.. view.php: If users clicks an event title, they’re taken to this page where the event’s data is displayed in detail.. admin.php: To create or modify new events, the form displayed on this page...
tailieu.vn Xem trực tuyến Tải xuống
This allows you to create a database object and pass it for use in the class easily.. To keep the database credentials separate from the rest of the application for easy maintenance, you want to use a configuration file. Create a new file called db-cred.inc.php in the config folder. (/sys/config/db-cred.inc.php). The database host URL. The database username. The database password....
tailieu.vn Xem trực tuyến Tải xuống
The event ID. The event title. The event description. $this->id = $event['event_id'];. $this->title = $event['event_title'];. $this->description = $event['event_desc'];. $this->start = $event['event_start'];. $this->end = $event['event_end'];. throw new Exception("No event data was supplied.");. Next, extract the day of the month from each event’s start date and add a new value to the array at that day’s index. In the Calendar class, create...
tailieu.vn Xem trực tuyến Tải xuống
Displaying Events in the Calendar. Adding the events to the calendar display is as easy as loading the events array from _createEventObj() and looping through the events stored in the index that matches the current day if any exist. Add event data to the calendar markup using the following bold code:. Determine the calendar month and create an array of...
tailieu.vn Xem trực tuyến Tải xuống
Because the markup generation is fairly simple when only using one event, all this method will do is load the desired event by its ID using _loadEventData() and then return the first—and only, due to the LIMIT 1 clause—result from the method.. Add the following method to the Calendar class:. @param int $id an event ID * @return object the...
tailieu.vn Xem trực tuyến Tải xuống
Creating a File to Display the Form. This file will be called admin.php, and it will reside in the root level of the public folder (/public/admin.php).. Similar to view.php, this file accomplishes the following:. Next, add the following inside the new admin.php file:. include_once '../sys/core/init.inc.php';. $css_files = array("style.css");. include_once 'assets/common/header.inc.php';. include_once 'assets/common/footer.inc.php';. After saving this code, navigate to http://localhost/admin.php to...
tailieu.vn Xem trực tuyến Tải xuống
Save this file, and then navigate to http://localhost/admin.php and create a new event with the following information:. After clicking the Create new event button, the calendar is updated with the new event (see Figure 5-3).. Adding a Button to the Main View to Create New Events. To make it easier for your authorized users to create new events, add a...
tailieu.vn Xem trực tuyến Tải xuống
To start, add a Delete button to the full view edit controls by modifying _adminEntryOptions() in the Calendar class with the code shown in bold:. Generates edit and delete options for a given event ID. @param int $id the event ID to generate options for * @return string the markup for the edit/delete options. <form action="admin.php". value="Edit This Event". name="event_id"....