小编Lin*_*ude的帖子

谷歌索引内容是否会在内联 javascript 变量中声明?

我似乎无法找到明确的答案。如果我的页面是这样的:

<html>
<head>
  <script>
    var mypets = [ 
        { 'type': 'dog', 'name':'rover' }, 
        { 'type': 'cat', 'name':'kitty' }];
    $('#btnShowEm').click(function() { $('#emptyAtFirst').text(mypets[0].name); });
 </script>
</head>
<body>
  <div id='emptyAtFirst'></div>
  <button id='btnShowEm">ShowEm</button>
</body>
<html>
Run Code Online (Sandbox Code Playgroud)

即使“mypets”数据在开始时未显示在 html 中,Google 也会将其编入索引吗?现实世界的页面在一个类似的 javascript 对象中声明了大量内容,并显示其中的一些内容以响应用户操作;我想知道我是否必须做更多的事情才能根据所有内容对页面进行索引,而不仅仅是在 javascript 内容运行之前在 html 中可见的内容。

javascript googlebot

6
推荐指数
1
解决办法
952
查看次数

How to match Nullable Date parameter in f#

Learning F#, can't find the answer to this... I'd like to handle case where a Nullable parameter (DateTime? in the original c#) is null, but I get the error "Nullable does not have null as a proper value". What is the correct way to do this?

let addIfNotNull(ht:Hashtable, key:string, value:Nullable<DateTime>) = 
        match value with 
        | null -> ()
        | _ -> ht.Add(key,value)
        ht  
Run Code Online (Sandbox Code Playgroud)

f# nullable

3
推荐指数
1
解决办法
167
查看次数

标签 统计

f# ×1

googlebot ×1

javascript ×1

nullable ×1