TAILIEUCHUNG - Building OpenSocial Apps- P4

Building OpenSocial Apps- P4: Nhà phát triển của Thư viện Series từ Addison-Wesley cung cấp hành nghề lập trình với độc đáo, tài liệu tham khảo chất lượng cao hướng dẫn về các ngôn ngữ lập trình công nghệ mới nhất và họ sử dụng trong công việc hàng ngày của họ. Tất cả các sách trong thư viện của Nhà phát triển được viết bởi chuyên gia công nghệ các học viên những người có kỹ năng đặc biệt tại các tổ chức và trình bày thông tin một cách đó là hữu ích cho các lập trình viên khác | 124 Chapter 7 Flushing and Fleshing Expanding Your App and Person-to-Person Game Play only the picked opponent in the availableGames div. Later on we ll make it do something more interesting. function opponentPickedAction person var elem availableGames 4. Immediately after the opponentPicked function add the following loadFriendPicker function makes use of the widget Bootstrapper object to initialize the FriendPicker widget. The Bootstrapper allows us to safely create a widget from a dynamically included script library. The call to createWidget takes three parameters the object name of the widget being created an initializer function to fire when the widget has been created and an object of parameters to pass into the widget at initialization. In this case we re passing in the ID of our target div element a callback function to execute whenever a friend is picked and a flag to build the Selected User user interface element. function loadFriendPicker function p p element opponentPicker buildSelectedUI true friendClickAction opponentPicked 5. In our loadinitializer function add a call to loadFriendPicker function loadInitializer try loadWordOfTheDay catch ex try initializeGame catch ex loadFriendPicker Please purchase PDF Split-Merge on to remove this watermark. Turn-Based Games 125 Figure FriendPicker below player info. Warning The call to initialize a FriendPicker must be made from a . registerOnLoadHandler-triggered function. If we try to initialize from an inline call the initializer will fail in some browsers. Not all browsers handle dynamic script loading in the same manner so we must use the least common denominator behavior. If we save and view our app we ll see the FriendPicker initialized below the current viewer UI. Clicking on the Click for Recipient .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.