# JS Help

**URL:** <https://www.phphelp.com/t/js-help/18960>\
**Category:** Javascript & Ajax\
**Created:** [November 21, 2012, 10:29pm UTC](https://www.phphelp.com/t/js-help/18960 "2012-11-21T22:29:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kratos](https://www.phphelp.com/letter_avatar_proxy/v4/letter/k/4af34b/32.png) [@Kratos](https://www.phphelp.com/u/Kratos)\
**Post date:** [November 21, 2012, 10:29pm UTC](https://www.phphelp.com/t/js-help/18960/1 "2012-11-21T22:29:21Z")

</div>

This is my script.

```auto
<script>
function geturl() {
	var comment = window.document.comment.comment.value;
	var url = "../ajax/profile_comments.php?type=post&ajax=1&user=<?=$User?>&comment="+ escape(comment) +"&submit=Comment";
	loadpage(url);
}
function loadpage(url) {
	$('#comment').html('<br />Loading...<br /><br />');
	$('#comment').load(url);
}
</script>
```

My issue is whenever I post a link e.g [http://www.link.com](http://www.link.com) it won’t post but whenever I put [http://link.com](http://link.com) it works why is that?

---

<div class="post-metadata">

**Author:** ![m11](https://www.phphelp.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@m11](https://www.phphelp.com/u/m11)\
**Post date:** [November 21, 2012, 10:44pm UTC](https://www.phphelp.com/t/js-help/18960/2 "2012-11-21T22:44:48Z")

</div>

I’m guessing you are on [http://link.com](http://link.com) (without the www)?

I’m not sure if adding the www would be considered cross-domain.

---

<div class="post-metadata">

**Author:** ![Kratos](https://www.phphelp.com/letter_avatar_proxy/v4/letter/k/4af34b/32.png) [@Kratos](https://www.phphelp.com/u/Kratos)\
**Post date:** [November 21, 2012, 10:54pm UTC](https://www.phphelp.com/t/js-help/18960/3 "2012-11-21T22:54:22Z")

</div>

The script allows [http://link.com](http://link.com)

but when I add www. it just says “Loading…”
