View Full Version : Đưa thêm thông tin tỉ giá, giá vàng, nhiệt độ vào trang web.
Sáng nay có một bạn hỏi ḿnh việc này đầu bài như sau :
- Đưa vào trang web của ḿnh các thông tin bao gồm : Thông tin tỷ giá, giá vàng và nhiệt độ, các biểu đồ chứng khoán mà không phải mất công ngồi nhập dữ liệu cho cái đám đó :021:
Ḿnh tạm thời giải quyết như sau :
- Download 4 file js từ vnexpress về bao gồm :
+ http://www.vnexpress.net/Library/Library.js
+ http://vnexpress.net/Service/Gold.js
+ http://vnexpress.net/Service/Weather.js
+ http://vnexpress.net/Service/Forex.js
Ok, sau đó ḿnh có thể chỉnh sửa các file đó sao cho hiển thị theo cách ḿnh muốn.
Tiếp tục ḿnh chèn đoạn code sau vào trang web của ḿnh
<script language="JavaScript" src="Library.js"></script>
<script type="text/javascript" language="JavaScript" src="http://vnexpress.net/Service/Gold_Content.js"></Script>
<script type="text/javascript" language="JavaScript" src="Gold.js"></Script>
<script type="text/javascript" language="JavaScript" src="http://vnexpress.net/Service/Weather_Content.js"></Script>
<script type="text/javascript" language="JavaScript" src="Weather.js"></Script>
<script type="text/javascript" language="JavaScript" src="http://vnexpress.net/Service/Forex_Content.js"></Script>
<script type="text/javascript" language="JavaScript" src="Forex.js"></Script>
:02: Thế là xong, nhờ luôn dữ liệu hàng ngày của VNExpress để hiển thị trên trang web của ḿnh :71:
Ông tướng xem chỉnh lại cái đi, xấu quá
Híc, tôi nói rõ là
"Ok, sau đó mình có thể chỉnh sửa các file đó sao cho hiển thị theo cách mình muốn."
Bố không chỉnh cứ thế phang lên, có cái ảnh minimize bố cũng lười down về bảo sao nó xấu. híc
Ḿnh tiếp tục giới thiệu cách lấy thông tin các giá các chỉ số chứng khoán nhé. Bác nào quan tâm th́ thanks nhé :014:
Bước 1 :
Vào địa chỉ http://www.vnexpress.net/Vietnam/Kinh-doanh/Chung-khoan/ sau đó save as trang web về (chú ư : save toàn bộ về máy với định dạng .htm), lưu với tên ChungKhoan.htm (Máy sẽ tạo ra 1 folder có tên là ChungKhoan chứa các ảnh cần thiết cho form này và file ChungKhoan.htm)
Bước 2 : Chạy thử file ChungKhoan.htm --> Nếu hiển thấy bảng giá chứng khoán hiển thị th́ tiếp tục, không thấy th́ cứ làm tiếp :E , kiểm tra kết nối Internet sau :014:
Bước 3 : Tạo một file hml mới có tên là CK.htm
Bước 4 : Tạo styles cho các thành phần hiển thị
<style type="text/css">
.cActive
{
background-image:url(/User/ck/Source/images/bg_active.gif);
font-family:Tahoma, "Times New Roman";
text-decoration:none;
font-size:11px;
color:#9e224d;
font-weight:bold;
}
.cNoActive
{
background-image:url(/User/ck/Source/images/bg_noactive.gif);
font-family:Tahoma, "Times New Roman";
text-decoration:none;
font-size:11px;
color:#009140;
font-weight:normal;
}
.tbHeader
{
border-left: 1px solid #666666;
border-right: 1px solid #666666;
}
.cHeader
{
font-family:Tahoma, "Times New Roman";
font-size:11px;
background-color:#9e224d;
color:#FFFFFF;
font-weight:bold
}
.cHeaderN
{
font-family:Tahoma, "Times New Roman";
font-size:11px;
background-color:#af637d;
color:#FFFFFF;
font-weight:bold
}
.Active
{
font-family:Tahoma, "Times New Roman";
text-decoration:none;
font-size:12px;
color:#9e224d;
font-weight:bold;
cursor: pointer;
}
.NoActive
{
font-family:Tahoma, "Times New Roman";
text-decoration:none;
font-size:12px;
color:#009140;
font-weight:normal;
cursor: pointer;
}
</style>
Bước 5 : Thêm đoạn code sau để hiển thị bảng giá, tận dụng dữ liệu được cung cấp từ CTy CK Vietcombank :105:
<script language="javascript">
function switchActive(i){
if(i == 0){
document.getElementById('cHoSTC').className = 'cActive';
document.getElementById('cHaSTC').className = 'cNoActive';
document.getElementById('aHoSTC').className = 'Active';
document.getElementById('aHaSTC').className = 'NoActive';
}
else{
document.getElementById('cHoSTC').className = 'cNoActive';
document.getElementById('cHaSTC').className = 'cActive';
document.getElementById('aHoSTC').className = 'NoActive';
document.getElementById('aHaSTC').className = 'Active';
}
}
</script>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td valign="top" width="210">
<table border="0" cellpadding="0" cellspacing="0" width="210">
<tbody><tr>
<td colspan="8" align="center" height="14" width="194"><img src="Chungkhoan_files/title.gif"></td>
</tr>
<tr>
<td colspan="7" align="justify" height="32" width="122"><img src="Chungkhoan_files/vnes_title.gif"></td>
<td rowspan="2" align="center" background="Chungkhoan_files/vcb_bg.gif" width="72"><img src="Chungkhoan_files/vcb_logo.gif"></td>
</tr>
<tr>
<td alt="" background="Chungkhoan_files/bd.gif" height="20" width="1"></td>
<td id="cHoSTC" class="cActive" alt="" align="center" height="20" width="58"><a href="http://www.vnexpress.net/User/ck/hcms/HCMStockSmall.asp" target="ifrmContent" id="aHoSTC" class="Active" onclick="switchActive(0);">HoSTC</a></td>
<td alt="" background="Chungkhoan_files/bd.gif" height="20" width="1"></td>
<td alt="" background="Chungkhoan_files/bg_out.gif" height="20" width="2"></td>
<td alt="" background="Chungkhoan_files/bd.gif" height="20" width="1"></td>
<td id="cHaSTC" class="cNoActive" alt="" align="center" height="20" width="58"><a href="http://www.vnexpress.net/User/ck/hns/HNStockSmall.asp" target="ifrmContent" id="aHaSTC" class="NoActive" onclick="switchActive(1);">HaSTC</a></td>
<td alt="" background="Chungkhoan_files/bd.gif" height="20" width="1"></td>
</tr>
</tbody></table>
<table class="tbHeader" border="0" cellpadding="1" cellspacing="1" width="210">
<tbody><tr align="center">
<td rowspan="2" class="cHeader" align="center" width="38">Mă CK</td>
<td rowspan="2" class="cHeader" align="center" width="38">TC</td>
<td colspan="2" class="cHeader" align="center" nowrap="nowrap" width="82">Khớp lệnh</td>
<td rowspan="2" class="cHeader" align="center" width="52">+/-</td>
</tr>
<tr>
<td class="cHeaderN" align="center" width="37">Giá</td>
<td class="cHeaderN" align="center" width="45">KL</td>
</tr>
</tbody></table>
<iframe id="ifrmContent" name="ifrmContent" height="305" width="210" src="http://www.vnexpress.net/User/ck/hcms/HCMStockSmall.asp" noresize border=false frameborder=0 scrolling="no"></iframe>
<table>
<tbody><tr>
<td style="background: rgb(255, 255, 255) none repeat scroll 0%; font-size: 8pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: 'Arial'; text-align: right;" align="center">(Bấm vào nội dung bảng để xem chi tiết)</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table><table>
Kinh dị nhỉ? để xem có đưa lên được không
rosekiller
15-05-07, 06:45 PM
thôi thôi ông ơi, không cần thiết đâu. Đưa mấy cái tin hot hot về công nghệ thì hay hơn.
:( Úi các bác này buồn cười nhỉ, cái này em hướng dẫn người ta làm quen với việc phát triển các hệ thống web mà.
Admin thấy dùng được cái nào thì dùng mà ... không an ủi box web thì thôi lại còn... hic hic.. tủi thân vãi
Hi hi hi, từ từ rồi khoai sẽ nhừ.
HI vọng cái form tìm việc thỏa mãn được sự bức xúc của anh em :)
thangtam
08-06-07, 06:01 PM
cái đấy hay ra phết có tích hợp vào powerpoint được không ?
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.