1.谷歌瀏覽器圖片地址失敗顯示黑色邊框問題javascript
描述:谷歌瀏覽器在圖片地址載入失敗時,會提供內部的錯誤處理機智,加上黑色邊框php
解決:經過屬性選擇器,若是img的src爲空,咱們設置透明度爲0java
img[src=""]{ opacity:0; }
2.input是password密碼框,自動填充數據問題;ajax
描述:在input類型爲password ;會自動初始化頁面填充記錄的密碼等信息瀏覽器
解決:初始化input類型先爲text,在獲取焦點時改成passwordapp
<input autocomplete="off" type="text" onfocus="this.type='password'" />
3. AngularJS 應用在加載時防止 AngularJS 代碼未加載完而出現的問題this
<element ng-cloak></element>
4. AngularJS 圖片img引用控制器ajax返回路徑問題url
咱們的img標籤的src配合ng會以下使用:code
結構:圖片
<img src="{{url}}" />
控制器:
app.controller('cController', function($scope, $http,$location) { $http.get("xxx.php").then(function (response) { $scope.url=response.url; }); });
咱們頁面初始化加載,由於ajax尚未返回咱們的真正地址,因此img的src的地址是找不到的,就會出現一個404錯誤,如何解決這個問題:
咱們使用ng的ng-src指令
<img ng-src="{{url}}" />
5. ajax請求,base64字符串部分字符後臺接收出現問題
主要就是 + 和 & 字符後臺接收被轉爲其餘字符
bas64img = bas64img.replace(/\+/g, "%2B"); bas64img = bas64img.replace(/\&/g, "%26");
持續更新......